📜  java 8 map foreach - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:19.784000             🧑  作者: Mango

代码示例6
public void iterateUsingIteratorAndEntry(Map map) {
    Iterator> iterator = map.entrySet().iterator();
    while (iterator.hasNext()) {
        Map.Entry entry = iterator.next();
        System.out.println(entry.getKey() + ":" + entry.getValue());
    }
}