public static void test(){
HashMap<Integer,String> hm=new HashMap<Integer,String>();
hm.put(1,"zhangsan");
hm.put(2,"lisi");
hm.put(3,"wangwu");
Set<Map.Entry<Integer, String>> s = hm.entrySet();
Iterator<Map.Entry<Integer, String>> i = s.iterator();
while(i.hasNext()) {
Map.Entry<Integer, String> me = i.next();
System.out.println(me.getKey() + ": " + me.getValue());
}
HashMap<Integer,String> hm=new HashMap<Integer,String>();
hm.put(1,"zhangsan");
hm.put(2,"lisi");
hm.put(3,"wangwu");
Set<Map.Entry<Integer, String>> s = hm.entrySet();
Iterator<Map.Entry<Integer, String>> i = s.iterator();
while(i.hasNext()) {
Map.Entry<Integer, String> me = i.next();
System.out.println(me.getKey() + ": " + me.getValue());
}