Hi
i would like to add Comparator objects to TreeSet, while doing ClassCastException throwing. Could you please help on this.
My question is when I implement my custom class with comparable every this goes fine. But what is the way to add Comparator objects to Treeset?
Exception in
thread "main" java.lang.ClassCastException: com.exceptions.Person cannot be cast to java.lang.Comparable