What does the return value inside the Comparator actually mean?
For example :
class TreeSetDemo
{
public static void main(String
Depending on how you want to sort based on this comparator you need to place some logic in the comparator. Your comparator only returns 0 which means equal
class MyComparator implements Comparator {
public int compare(Object o1, Object o2) {
// TODO Auto-generated method stub
return o1.compareTo(o2);
}
}