A Legacy Notes Developer's journey into madness.

Stupid equality test -my most common Java bug.

Devin Olson  December 10 2012 01:01:59 PM
I was first introduced to Java (as a Programming Language) around 1997 or 1998, and I've been working with it on a semi-regular basis since around 2001.  

Since July of this year I have been working with it on a daily basis.  

But even with being "elbow deep" in the language all this time, I continue to make this simple, stupid mistake.  

So I'm posting it here hoping that it will help me remember, and perhaps help others as well.  


(myString == anotherString)  

IS NOT EQUIVALENT to

(myString.equals(anotherString))




Sigh.  

-Devin.
Comments
No Comments Found

Discussion for this entry is now closed.