json转对象
User user = (User)JSON.parseObject(jsonStr,User.class);
对象转json
JSONObject json = JSONObject.fromObject(obj);
字符串转json
JSONObject jsonStr = JSONObject.parseObject(str);
json转字符串
jsonStr.toString(); //用不上
json转对象
User user = (User)JSON.parseObject(jsonStr,User.class);
对象转json
JSONObject json = JSONObject.fromObject(obj);
字符串转json
JSONObject jsonStr = JSONObject.parseObject(str);
json转字符串
jsonStr.toString(); //用不上