Implementing the java.lang.Comparable Interface – Object ComparisonImplementing the java.lang.Comparable Interface – Object Comparison
14.4 Implementing the java.lang.Comparable<E> Interface In order to sort the objects of a class, it should be possible to compare the objects. A total ordering allows objects to be compared. [...]