Comparator

TreeSet with user defined objects in Java

TreeSet with user defined objects in Java TreeSet is an implementation of the Set interface that uses a TreeMap for storing elements. TreeSet [...]

Comparable and Comparator interface in java

Comparable and Comparator: Comparable and Comparator both are interfaces in Java used to sort elements in collection. Difference between comparable and [...]