首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

java遍历地图的一种方法

2013-03-01 
java遍历map的一种方法SetMap set new HashSetMap()for(int i0i6i++){MapString, Integer ma

java遍历map的一种方法
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)); }}

热点排行