A Java Interface signifying the client that it can compare two objects which implement this. Essentially, it forces the existence of the compareTo(T otherObj) method -- depicted below. This tells a user it can use this method to compare these two objects. Typically this comparable also allows the proper implementation of an equals(Object other) method, as this would be any case in which compareTo(T otherObj) would return a 0.
public interface Comparable<T> {

public int compareTo(T otherObj);

}
by gunvalid January 22, 2019
Get the Comparable<T> mug.