I have an if statement which is returning a NullPointerException.
Object obj;
if (obj.toString().equals("string"))
The expected result is a NullPointerException as obj has no value assigned to it, and it's being compared to a String.
Now considering the condition below
Object obj;
if (obj.toString().equals(null))
obj still being null (as I haven't assigned a value to it), although shouldn't my if statement return as true since obj is being compared to null?