我想在java中使用org.json库创建json字符串,以下是代码片段。使用org.json在java中创建JSON
JSONArray jSONArray = new JSONArray();
JSONObject jSONObject = new JSONObject();
jSONObject.accumulate("test", jSONArray);
System.out.println(jSONObject.toString());
我希望它打印
{"test":[]}
而它打印
{"test":[[]]}