I wanted to clarify if I understand this correctly: == is a reference comparison, i.e. both objects point to the same memory location . . equals() evaluates to the comparison of values in the objects .
Read moreCan you use == for objects in Java?
In Java, the == operator compares that two references are identical or not . Whereas the equals() method compares two objects. Objects are equal when they have the same state (usually comparing variables). Objects are identical when they share the class identity.
Read more