如何使用 JSONObject 在 Java 中创建正确的 JSONArray
如何在Java中使用JSONObject创建如下所示的JSON对象?
{
"employees": [
{"firstName": "John", "lastName": "Doe"},
{"firstName": "Anna", "lastName": "Smith"},
{"firstName": "Peter", "lastName": "Jones"}
],
"manager": [
{"firstName": "John", "lastName": "Doe"},
{"firstName": "Anna", "lastName": "Smith"},
{"firstName": "Peter", "lastName": "Jones"}
]
}
我发现了很多例子,但不是我确切的JSONArray字符串。