标签:entry tor iterator next ext sys map遍历 system key
//map的入口集合
for(Map.Entry<String, String> mEntry:map.entrySet()){
String key=mEntry.getKey();
String value =mEntry.getValue();
System.out.println(key+": "+value);
}
//map的迭代器
Iterator<Entry<String, String>> iterator = map.entrySet().iterator();
while(iterator.hasNext()){
Entry<String, String> next = iterator.next();
System.out.println(next.getKey()+": "+next.getValue());
}
//map的key集合
for(String key:map.keySet()){
System.out.println(key+": "+map.get(key));
}
标签:entry tor iterator next ext sys map遍历 system key
原文地址:https://www.cnblogs.com/cstdio1/p/12129089.html