Comparable interface in Java

Comparable Interface   The Comparable interface declares a compareTo() method that is used to define natural order of objects of class implementing it.   The signature of this method is :   int compareTo(T obj)   This method compares the invoking object with the object passed to it as the method parameter.   It returns […]