What does the return value inside the Comparator actually mean?
For example :
class TreeSetDemo { public static void main(String
It's about sort algorithm which needs compare.
Correct:
class MyComparator implements Comparator { public int compare(Integer o1, Integer o2) { // Calling the Integer class's compareTo method return o1.compareTo(o2); } }