{"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); }
執(zhí)行結果
111
添加回答
舉報
0/150
提交
取消