{"code":"11","msg":"查询成功","result":{"宁夏图书馆":"111","首都图书馆":"111","AS":"16"},"success":true}关键是这里{"宁夏图书馆":"111","首都图书馆":"111"}这样的怎么解析?
1 回答
紫衣仙女
TA贡献1839条经验 获得超15个赞
public static void main(String[] args) { String a = "{\"code\":\"11\",\"msg\":\"查询成功\",\"result\":{\"宁夏图书馆\":\"111\",\"首都图书馆\":\"111\",\"AS\":\"16\"},\"success\":true}"; Map o = JSONObject.parseObject(a, Map.class); Map map1 =(Map) o.get("result"); System.out.println(map1.toString()); Object object = map1.get("宁夏图书馆"); System.out.println(object); }
执行结果
111
添加回答
举报
0/150
提交
取消