JSONObject jsonObject = new JSONObject(s);
然后用Iterator迭代器遍歷取值,建議用反射機制解析到封裝好的對象中
JSONObject jsonObject = new JSONObject(jsonString); Iterator iterator = jsonObject.keys(); while(iterator.hasNext()){ key = (String) iterator.next(); value = jsonObject.getString(key); }