// 创建Mapmapp<String, Object> map= new HashMap<>();infoMap.put("a", "a");infoMap.put("b", "b");infoMap.put("c", "c");// 传统的Map迭代forr (Map.Entry<String, Object> entry : map.entrySet()) { System.out.println(entry.getKey() + ":" + entry.getValue());}// Mapp的JDK8迭代模式.forEach((key, value) -> { System.out.println(key + ":" + value);});