List list = new ArrayList();
Map mp=new HashMap();
mp.put("w", "aaaaaaa");
mp.put("q", "bbbbbbb");
mp.put("d", "cccccccccc");
mp.put("f", "ddddddd");
list.add(mp);
long begin=System.currentTimeMillis();
for (int i = 0; i <list.size(); i++) {
HashMap pp=(HashMap)list.get(i);
Iterator itr = pp.entrySet().iterator();
while(itr.hasNext()){
Map.Entry entry=(Entry) itr.next();
System.out.println(entry.getKey()+"--"+entry.getValue());
}
}
long end=System.currentTimeMillis();
System.out.println(end-begin);
循环MAP
最新推荐文章于 2023-12-18 18:46:47 发布