1. 程式人生 > >JSONObject.parseObject(jsonStr);和JSONObject.fromObject(jsonStr);

JSONObject.parseObject(jsonStr);和JSONObject.fromObject(jsonStr);

parse ali .json obj 返回json json.js rom 都是 object

雖然都是返回JSONObject,但是

JSONObject.parseObject(jsonStr);這個方法需要導入import com.alibaba.fastjson.JSONObject;

JSONObject.fromObject(jsonStr);這個方法需要導入import net.sf.json.JSONObject;

JSONObject.parseObject(jsonStr);和JSONObject.fromObject(jsonStr);