There's always:
String a = "wow, not the same";
String b = "wow, not the same";
String c = new String("wow, not the same");
if (a == b) { //happens to evaluate to true, but you shouldn't do this
...
}
if (a == c) { //evaluates to false, which is why you shouldn't do it
...
}
//This is how you *should* do this
if (a.equals(b)) { //evaluates to true
...
}
if (a.equals(c)) { //evaluates to true
...
}