java解析json串常识

注意:JSONObject 和JSONArray的使用区别


报错:A JSONObject text must begin with '{' at character 1 of    

分析:  JSONObject json=JSONObject.fromObject(strInput);中的字符串strInput必须是以{开头儿的。


报错:A JSONArray text must start with '[' at character 1 of 

分析:JSONArray array=JSONArray.fromObject(strInput));中的字符串strInput)必须是以[开头儿的。严格注意二者使用区别。

原文地址:https://www.cnblogs.com/hq-123/p/8579029.html