How to achieve always?
The compareTo
method or compare
method should be consistent with the equals
method of the object being stored in TreeMap
or TreeSet
?
How to achieve always?
The compareTo
method or compare
method should be consistent with the equals
method of the object being stored in TreeMap
or TreeSet
?