Interface java.util.Comparable
public interface Comparable {
public int compareTo (Object that); // Return a negative integer if this object is less than that, // or zero if this object is equal to that, // or a positive integer if this object is greater than that.
The compareTo method captures the notion of less (greater) for objects.
If a class implements Comparable, it must implement compareTo in accordance with its “contract”.