Check out example codes for "TreeMap descendingMap() method in java". It will help you in understanding the concepts better.

Code Example 1

import java.util.NavigableMap;
import java.util.TreeMap;
public class TreeMapDescendingMapMethodExample
{
   public static void main(String[] args)
   {
      TreeMap<Integer, String> tm = new TreeMap<Integer, String>();
      tm.put(93, "blue");
      tm.put(26, "violet");
      tm.put(63, "red");
      tm.put(53, "green");
      tm.put(96, "five");
      // put values in NavigableMap
      NavigableMap nm = tm.descendingMap();
      System.out.println("TreeMap values using descendingMap() method: ");
      System.out.println("NavigableMap values: " + nm);
   }
}

Learn ReactJs, React Native from akashmittal.com