Wednesday, May 14, 2008

Difference between == and equals() for two String variables


equals()’ for class ‘String’ has been overridden to check if both the objects represent the same sequence of characters or not. ‘==’ simply checks if both the reference variables have the same value or not. That means, if both the object references point to the same object or not.



Share/Save/Bookmark


No comments: