方法1:
for (Map.Entry<String, Student> entry : stuMap.entrySet()) {
stuStr = entry.getKey();
stu = entry.getValue();
}
方法2:
Iterator<Map.Entry<String,Student>> it = stuMap.entrySet().iterator();
while (it.hasNext()) {
Map.Entry<String,Student> entry = it.next();
stuStr = entry.getKey();
stu = entry.getValue();
}
方法3:
for (String stuKey : stuMap.keySet()) {
stuStr = stuKey;
stu = stuMap.get(stuKey);
}