String json = "[{"id": "1","name": "zhangsan"}, {"id": "2","name": "lisi"}, {"id": "3","name": "wangwu"}]";
//json字符串 转 json 数组
JSONArray jsonarrr = JSONArray.parseArray(json);
//json数组 转java对象
List<User> userlist = jsonarrr.toJavaList(User.class);
String json = "{"id": "1","name": "zhangsan"}";
//json字符串 转 json 对象
JSONObject jsondx = JSONObject.parseObject(json);
//json对象 转 java对象
User userlist = jsondx.toJavaList(User.class);