treemap firstentry 28 29 method in java

Solutions on MaxInterview for treemap firstentry 28 29 method in java by the best coders in the world

showing results for - "treemap firstentry 28 29 method in java"
Monica
27 Nov 2017
1import java.util.TreeMap;
2public class TreeMapFirstEntryMethodExample
3{
4   public static void main(String[] args)
5   {
6      TreeMap<Integer, String> tm = new TreeMap<Integer, String>();
7      tm.put(69, "mango");
8      tm.put(53, "apple");
9      tm.put(26, "orange");
10      tm.put(38, "grapes");
11      tm.put(50, "banana");
12      System.out.println("Checking TreeMap for first entry: ");
13      System.out.println("TreeMap firstEntry is: " + tm.firstEntry());
14   }
15}