Comparable
-
Comparable, Comparator, and Collection SortStaticPL/JAVA 2020. 3. 15. 19:24
1. Overview Comparable Comparator Comparable interface is used to sort the objects with natural ordering. Comparator in Java is used to sort the attributes of different objects. Comparable interface compares “this” reference with the object specified. Comparator in Java compares two different class objects provided. Comparable is present in java.lang package. A Comparator is present in the java...