[new features of Java 8] Java Comparator | comparator

The java.util.comparator function interface sorts the collection of objects in total. To sort a collection, we pass instances of the comparator to the Stream.sorted, Collections.sort, List.sort, and Arrays.sort methods. The comparator can also control the order of SortedSet and the key order of SortedMap data structure. The function meth ...

Posted on Sat, 18 Sep 2021 10:42:17 -0400 by mentalist