Java 遍历Map
1. 迭代器遍历
2. for-each遍历
for(Map.Entry<String,Integer> cur:mp.entrySet()){ System.out.println(cur.getKey()+" "+cur.getValue()); }
1. 迭代器遍历
2. for-each遍历
for(Map.Entry<String,Integer> cur:mp.entrySet()){ System.out.println(cur.getKey()+" "+cur.getValue()); }