Answer : Difference is == compares just two references for non-primitives – i.e. it will test whether the two operands refer to the same object. It will check if the objects refer to same place on the memory.
On the other hand, equals method could be overridden – so two distinct objects will be equal. Actually equals method compares the contents of two objects, and not their location in memory as == compares. Please see example below: