标签:
1 public static void printMap(Map mp) { 2 Iterator it = mp.entrySet().iterator(); 3 while (it.hasNext()) { 4 Map.Entry pair = (Map.Entry)it.next(); 5 System.out.println(pair.getKey() + " = " + pair.getValue()); 6 it.remove(); // avoids a ConcurrentModificationException 7 } 8 }
标签:
原文地址:http://www.cnblogs.com/wufeng0927/p/5374290.html