Using == on a String compares if the 2 objects you are comparing are the same object, it doesn't compare the actual contents of the String.