Java examples for Collection Framework:TreeMap
Add and get value to TreeMap
import java.util.TreeMap; public class Main { public static void main(String[] args) { TreeMap treeMap = new TreeMap(); treeMap.put("One", new Integer(1)); treeMap.put("Two", new Integer(2)); Object obj = treeMap.get("Two"); System.out.println(obj); /* w w w.j a v a 2 s. co m*/ } }