`

Map的遍历

阅读更多
//countMap已存在的Map集合
Iterator it=countMap.entrySet().iterator();
while(it.hasNext()){
Map.Entry<String, Integer> tempMap=(Entry<String, Integer>) it.next();
//获取键和值
System.out.println(tempMap.getKey()+":"+tempMap.getValue());

}
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics