The reason that this is important is that == checks if one object is the same as another object, and that's not what you care about here. Rather you want to check if one String has the same characters as another String and that's what the equals method does.