Set<Map> set = new HashSet<Map>();
for(int i=0;i<6;i++){
Map<String, Integer> map = new HashMap<String, Integer>();
map.put("1", 1);
set.add(map);
}
for(Map<String, Integer> m:set){
Set<String> s=m.keySet();
for (Iterator it = s.iterator(); it.hasNext();) {
String ss = (String) it.next();
System.out.println(m.get(ss));
}
}
java遍历map的一种方法
最新推荐文章于 2022-10-22 16:34:32 发布