String s = "{\"name\":\"测试\"}";
JSONObject o = JSONObject.parseObject(s);
System.out.println(o);
JSONArray array = new JSONArray();
array.add(o);
array.add(o);
System.out.println(array.toJSONString());
System.out.println(array.toString());
运行结果是:
{"name":"测试"}
[{"name":"测试"},{"$ref":"$[0]"}]
[{"name":"测试"},{"$ref":"$[0]"}]
1条答案
按热度按时间r9f1avp51#