Java String.equals versus == - Stack Overflow
Use the string.equals(String other) function to compare strings, not the == operator. The function checks the actual contents of the string, the == operator checks whether the references to the objects are equal. Note that string constants are usually "in...