猿问

怎么把List<Map<String,Object>>得结果转换为想要的数据

[{"appointtime":"2015-12-31 00","count":0},{"appointtime":"2015-12-31 01","count":0},{"appointtime":"2015-12-31 02","count":0}]

[["2015-12-31 00",0],["2015-12-31",01],["2015-12-31 02",0]]


乌云下的风
浏览 3814回答 2
2回答

你好小Song

Map<Object,Object> map = new HashMap<>(); for(Map<String,Object> m:list){     map.put(m.get("appointtime"),m.get("count")); } System.out.println(map); 另: 楼主题目的结果数据是不是写错了, 应该为[["2015-12-31 00",0],["2015-12-31 01",0],["2015-12-31 02",0]]

慕粉3233872

Map<Object,Object> map = new HashMap<>(); for(Map<String,Object> m:list){     map.put(m.get("appointtime"),m.get("count")); } System.out.println(map);
随时随地看视频慕课网APP

相关分类

Java
JavaScript
我要回答