Java: ==, .equals(), compareTo(), and compare()
Comparison Primitives Objects a == b, a != b Equal values Compares references, not values. The use of == with object references is generally limited to the following: Comparing to see if a reference is null. Comparing two enum values. This works ......