When you get an object using the new keyword and thus calling the constructor, you will never get that object as null. i.e Constructors never return null objects.
To test if an object is null you simply use
sorry i'm not using the constructor.
My code is inside the method A which i'm calling is :
testObj test = null;
//Invoke this method
search(String str)
return test ;
When the search doesnot match any case, then it returns the tes obj as null.
So in may main program how can i check if the testObj is null.
I use
if(test==null || test.equlas("")
But this does not work