Algorithm and data structure examples in Java.
The java.util.Map interfaceís subtype is the java.util.SortedMap. Functionality of java.util.Map is extended by this interface and elements are sorted which have been stored in the Map, internally.
Elementís sorting orders are as following: If java.lang.Comparable is implemented then it means that there exist elementís natural sorting order.Comparator determines the order which you will be providing to the SortedSet.
Default sorting orders are ascending