1. demo
{ "0": { "name": "医学影像资料", "infoList": [ { "name": "梵蒂冈", "num": 1 } ] }, "1": { "name": "检查报告单", "infoList": [ { "name": "昂", "num": 1 } ] } }
2.方法
public static void test1(){ String json = "{'0':{'name':'医学影像资料','infoList':[{'name':'梵蒂冈','num':1}]},'1':{'name':'检查报告单','infoList':[{'name':'昂','num':1}]}}"; JSONObject jsonObject = JSONUtil.parseObj(json); for (Map.Entry<String, Object> entry : jsonObject.entrySet()) { System.out.println("Key = " + entry.getKey() + ", Value = " + entry.getValue()); } }