标签:
如下,用 JSONTokener 实现:
Object json = new JSONTokener(stringData).nextValue();
if(json instanceof JSONObject){
JSONObject jsonObject = (JSONObject)json;
//further actions on jsonObjects
//...
}else if (json instanceof JSONArray){
JSONArray jsonArray = (JSONArray)json;
//further actions on jsonArray
//...
}
标签:
原文地址:http://www.cnblogs.com/spring87/p/5649500.html