In case of String objects: '==': does reference check while .equals() method: checks the contents of the two String objects. The following example will illustrate the difference between the two: