A JSONObject is an unordered collection of name/value pairs. Its external form is a string wrapped in curly braces (花括号)with colons(冒号) between the names and values, and commas(逗号) between the values and names. The internal form is an object having get() and opt() methods for accessing the values by name, and put() methods for adding or replacing values by name. The values can be any of these types: Boolean, JSONArray, JSONObject,Number, and String, or the JSONObject.NULL object.
eg. 一个Jason object:
jason_object_1 = {"account":"Li","Device":"iphone","path":"c:\\"}
A JSONArray is an ordered sequence of values. Its external form is a string wrapped in square brackets(方括号) with commas(逗号) between the values. The internal form is an object having get() and opt() methods for accessing the values by index, and put() methods for adding or replacing values. The values can be any of these types: Boolean, JSONArray, JSONObject, Number, and String, or the JSONObject.NULL object.
eg. 一个jasonArray:
["string",jason_object_1]
The JSONString is an interface that allows classes to implement their JSON serialization.
阅读(1400) | 评论(0) | 转发(0) |