Link to home
Start Free TrialLog in
Avatar of jayrod
jayrodFlag for United States of America

asked on

object is null

I would like to know if there is a method or something that I could inherit that would tell me if my object is null or not?  i.e. all of the properties are empty and have not been set.
Avatar of tinchos
tinchos

If an object is null, you cannot access its methods, properties or attributes

In order to know if an object is null you would do

object myObj;

// Code

if( myObj is null )
{
    // myObj is null
}
else
{
    // myObj is not null
}

Hope this helps

Tincho
if( myObj == null )
...
ASKER CERTIFIED SOLUTION
Avatar of ihenry
ihenry

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial