==
checks to see if they are actually the same object in memory (which confusingly sometimes is true, since they may both be from the pool), where as equals()
is overridden by java.lang.String
to check each character to ensure true equality. So therefore, equals()
is what you want.