import java.util.*;
public class map {
public static void main(String[] args) {
Map map = new TreeMap();
map.put("a", new Integer(1000));
map.put("b", 2000);
map.put("c", new Integer(3000));
map.put("d", new Integer(4000));
Set s = map.entrySet();
Iterator i = s.iterator();
while (i.hasNext()) {
System.out.println(i.next());
}
}
}
Output
a=1000 b=2000 c=3000 d=4000