|
Use the same data BEAN (an INT, a STRING, did not implement EQUALS () and HASHCODE ()), which implemented the compareTo () method in Comparable, and then added to HASHSET and TREESET respectively, why can be automatically in TREESET Two objects with the same ordering and status cannot be added to the TreeSet collection at the same time, but not in HASHSET. |
|