Note: (Restricted functionality due to obvious reasons!)

For Mobile-Ease ⇓

Minimal Code ( Raw-View ) :
import java.util.*; class SortedMapDemo { public static void main(String zee[]) { SortedMap m = new TreeMap(); //Interface variable = new ImplementationClass[of Interface-SortedMap] m.put(new Integer(103), "Deepak"); // m.put(key, value) m.put(new Integer(101), "Abhi"); m.put(new Integer(102), "John"); Set s = m.entrySet(); Iterator itr = s.iterator(); while(itr.hasNext()) { Map.Entry me = (Map.Entry)itr.next(); int a = (Integer)me.getKey(); String b = (String)me.getValue(); System.out.println(" "+a+" -> "+b); } } }