List<Map<String,String>> = new ArrayList<>() 循环问题: Map<String,String> map = new HashMap<>(); map.put("a","a"); map.put("b","b"); map.put("c","c"); map.put("d","d"); Map<String,String> map1 = new HashMap<>(); map1.put("1","1"); map1.put("2","2"); map1.put("3","3"); map1.put("4","4"); List<Map<String,String>> list = new ArrayList<>(); list.add(map); list.add(map1); for (Map<String,String> map2:list) { for (String s:map2.keySet()) { System.out.print("key:"+s+",value:"+map2.get(s)+"\n"); } }
08-09