JSONObject对象:
String jsonStr = "{\"name\":\"1\",\"age\":1,\"id\":0}";
// json字符串转为JSONObject 对象
JSONObject...("age:" + jsonObject.get("age"));
System.out.println("id:" + jsonObject.get("id"));
4.JSONObject转为json..., People.class);
System.out.println(people);
6.有时候,我们需要将一个集合json转化为一个java的List集合:
例如如下的一个json字符串:...:1,"id":1,"name":"first"},
{"age":2,"id":2,"name":"second"},
{"age":3,"id":3,"name":"third"}]
这个json字符串中包含的数据可以转化为一个...List集合,代码如下:
// 将List的Json字符串转化为List集合
String listStr = "[{\"age\":1,\"id\":1,\"name\":\