When should one compare String
s as objects and when should one use their equals
method? To make sure, I always use equals
, but that doesn't seem very efficient. In what situations can I be certain that string1 == string2
is a safe to use?
Thanks!