在jsp中怎么遍历hash地图
展开全部
Map<String, Object> map = new HashMap<String, Object>();
// 遍历key
for (String key : map.keySet()) {
System.out.println(key + " " + map.get(key));
}
// 遍历Entry
for (Entry<String, Object> entry : map.entrySet()) {
System.out.println(entry.getKey() + " " + entry.getValue());
}
// 遍历key
for (String key : map.keySet()) {
System.out.println(key + " " + map.get(key));
}
// 遍历Entry
for (Entry<String, Object> entry : map.entrySet()) {
System.out.println(entry.getKey() + " " + entry.getValue());
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询