My code is breaking on the following line with a nullpointerexception:
if (stringVariable.equals(null)){
Previous to this statement, I dec
The equals() method does not work with null parameter.
The method needs to have an object or string as parameter.
public boolean equals(Object anObject)
Since null is not an object. Is null an Object?.
Also refer to java 7 documentation which says that equals will give result if and only if the object passed is not null.
http://docs.oracle.com/javase/7/docs/api/java/lang/String.html#equals(java.lang.Object)