HashMap< Integer, Integer> hashMap=new HashMap<>();
hashMap.put(2, 3);
hashMap.put(5,6);
Iterator iterator=hashMap.entrySet().iterator();
while (iterator.hasNext()) {
HashMap.Entry entry = (Entry) iterator.next();
int a=(int) entry.getKey();
int b=(int) entry.getValue();
System.out.println(a+" "+b);
}
HashMap遍历
最新推荐文章于 2022-09-25 23:21:01 发布