treemap k firstkey 28 29 method in java

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

showing results for - "treemap k firstkey 28 29 method in java"
Franco
27 Jan 2019
1import java.util.TreeMap;
2public class TreeMapFirstKeyMethodExample
3{
4   public static void main(String[] args)
5   {
6      TreeMap<Integer, String> tm = new TreeMap<Integer, String>();
7      tm.put(2, "tejas");
8      tm.put(1, "om");
9      tm.put(3, "tarun");
10      tm.put(6, "siddarth");
11      tm.put(5, "fanindra");
12      System.out.println("first key of TreeMap: ");
13      System.out.println("First key is: " + tm.firstKey());
14   }
15}