1.使用Entry
//HashMap<String, Object> map
for(Entry<String, Object> e : map.entrySet()){
//function code
}2.使用Iterator
//HashMap<Map, Object> map
Iterator<Entry<String, Object>>myItera = map.entrySet().iterator();
while(myItera.hasNext()){
Entry<String, Object> e = myItera.next();
//function code
}
407

被折叠的 条评论
为什么被折叠?



