hashMap的遍历
来源:互联网 发布:iphone虚拟机型软件 编辑:程序博客网 时间:2024/06/05 21:10
第一种:
Map map = new HashMap();
Iterator iter = map.entrySet().iterator();
while (iter.hasNext()) {
Map.Entry entry = (Map.Entry) iter.next();
Object key = entry.getKey();
Object val = entry.getValue();
}
效率高,以后一定要使用此种方式!
第二种:
Map map = new HashMap();
Iterator iter = map.keySet().iterator();
while (iter.hasNext()) {
Object key = iter.next();
Object val = map.get(key);
}
效率低,以后尽量少使用!
0 0
- HashMap对象的遍历
- HashMap 的遍历
- hashmap的遍历
- Java_ABC_10.HashMap的遍历
- HashMap的遍历键值
- HashMap的遍历
- Hashmap的遍历
- HashMap的遍历方法
- HashMap的遍历
- HashMap HashTable 的遍历
- 遍历HashMap的方法
- android的HashMap遍历
- java HashMap的遍历
- 遍历HashMap的方法
- hashMap的遍历
- hashMap的遍历
- hashmap的遍历方法
- 【java】HashMap的遍历
- Please ensure that adb is correctly located at…某个解决方法
- Leetcode-Permutations II
- java中的书写规范、条件运算符、循环语句
- C++ prime plus 笔记(2)
- C5_二维数组练习
- hashMap的遍历
- android.os.NetworkOnMainThreadException异常
- cocos2d学习之旅(一)
- Sql Server (cast的用法)
- C#文件结构
- 算法导论 第六章:优先级队列
- linux编程基础(part2)
- C6_函数
- MyEclipse历史版本