用KeySet()方法;
Mapmap = new HashMap (); map.put(01, "a"); map.put(02, "b"); map.put(03, "c"); map.put(04, "d"); Set set = map.keySet(); ArrayList list = new ArrayList (set); for (int i = 0; i < list.size(); i++) { int s = list.get(i); System.out.println(s); Object o = map.get(s); System.out.println(o); System.out.println("==");