treemap v get 28object key 29 method in java

Solutions on MaxInterview for treemap v get 28object key 29 method in java by the best coders in the world

showing results for - "treemap v get 28object key 29 method in java"
Liam
25 Jan 2017
1import java.util.TreeMap;
2public class TreeMapGetObjectMethodExample
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("Check value of key 5: ");
13      System.out.println("Value is: " + tm.get(5));
14   }
15}