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

Code Example 1

import java.util.TreeMap;
public class TreeMapFirstEntryMethodExample
{
   public static void main(String[] args)
   {
      TreeMap<Integer, String> tm = new TreeMap<Integer, String>();
      tm.put(69, "mango");
      tm.put(53, "apple");
      tm.put(26, "orange");
      tm.put(38, "grapes");
      tm.put(50, "banana");
      System.out.println("Checking TreeMap for first entry: ");
      System.out.println("TreeMap firstEntry is: " + tm.firstEntry());
   }
}

Learn ReactJs, React Native from akashmittal.com