//遍历MAP方法,效率较低
Iterator it = map.keySet().iterator();
while(it.hasNext()){
String key = (String) it.next();
String value = map.get(key);
System.out.println(key + "→" + value);
}
时间: 2024-10-16 21:05:15
//遍历MAP方法,效率较低
Iterator it = map.keySet().iterator();
while(it.hasNext()){
String key = (String) it.next();
String value = map.get(key);
System.out.println(key + "→" + value);
}