Hi,
I've a simple object class as testObj.java with getter and setter methods.
In my code i need to check if the testObj object is null.
My code is :
testObj test = new testObj();
//invoke a method A which returns test as return type
if(test==null || test.equals("") )
{
System.out.prin tln("The test object is null);
}
But i'm not getting the expected results. How to check if this test object is null?
I've a simple object class as testObj.java with getter and setter methods.
In my code i need to check if the testObj object is null.
My code is :
testObj test = new testObj();
//invoke a method A which returns test as return type
if(test==null || test.equals("") )
{
System.out.prin tln("The test object is null);
}
But i'm not getting the expected results. How to check if this test object is null?
Comment