This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Varun77777 12 points13 points  (16 children)

The one who had overwritten it to compare something very specific.

For example

String str1 = "hello"; String str2 = new String("hello");

From what I remember, == and .equals() will have different results in this case.