Package java.lang

Interface Comparable<T>

    • Method Detail

      • compareTo

        int compareTo​(T another)
        Compares this object to the specified object to determine their relative order.
        Parameters:
        another - the object to compare to this instance.
        Returns:
        a negative integer if this instance is less than another; a positive integer if this instance is greater than another; 0 if this instance has the same order as another.
        Throws:
        ClassCastException - if another cannot be converted into something comparable to this instance.