Comparable:
A comparable object is capable of comparing itself with another object. The class itself must implements the java.lang.Comparable interface in order to be able to compare its instances. This interface imposes a total ordering on the objects of each class that implements it. This ordering is referred to as the class’s natural ordering, and the class’s compareTo method is referred to as its natural comparison method.
Comparator:
Comparator is an interface which is used for total ordering for some collection of objects. If you don’t rely on natural ordering that is done by class’s by implementing the comparable interface, you can define your custom comparator.
It is also useful when you have a predefined class in some jar library that don’t have implementation of comparable interface or that implementation is not as per your requirement. In that case you can use comparator for ordering.
Will post the example later…
Read More

Recent Comments