The == operator compares two variables to determine if they contain the same value. In the case of reference variables, that means that the == operator will determine if each variable contains the same value. That will only return true when both variables contain a reference to the same object.
However, if a class, such as String, overrides the equals method, you can call that method to determine if two objects contain the same values, not to reference variables.
Check out the JLS for more information:
§15.21.3 Reference Equality Operators == and != Corey