List<Map<String, Object>> listMaps = new ArrayList<Map<String, Object>>();
//只遍历值
for(Map<String,Object> map :listMap){
for(String s :map.keySet()){
System.out.println(map.get(s));
}
}
//遍历键和值
for(Map<String,Object> map:listMap){
for(Map.Entry<String,Object> m: map.entrySet()){
System.out.print(m.getKey()+" "+m.getValue());
}
}
list中存储map的情况下,遍历list
最新推荐文章于 2024-08-05 03:58:42 发布