(1) iterator方式: Iterator<Map.Entry<K,V>> iterator = map.entrySet().iterator(); while(iterator.hasNext()){ Map.Entry<K,V> entry = iterator.next(); entry.getKey(); entry.getValue(); } (2) for循环: for(Map.Entry<K,V> entry : map.entrySet()){ entry.getKey(); entry.getValue(); }