应该是双列集合和的多次嵌套把,下次吧题目要求也发出来,这样讲更详细
//增强for
for (Map.Entry<String, HashMap<String, String>> me : czbk.entrySet()) {
//me的获取key
String classNameKey = me.getKey();
//me的获取的值类型为hashmap
HashMap<String, String> numNameMapValue = me.getValue();
//增强for 遍历获取到的内层map
for (Map.Entry<String, String> nameMapEntry : numNameMapValue.entrySet()) {
//获取内层map的key
String numKey = nameMapEntry.getKey();
//获取内层map的values
String nameValue = nameMapEntry.getValue();
//打印
System.out.println(classNameKey + ".." + numKey + ".." + nameValue); |