var list = new Array(); var obj = {}; obj.name= "zhangsan"; obj.sex= "女";
obj.email="[email protected]";
...
list.push(obj);
list of values
When transmitting data to a web server, the data must be a string. By the JSON.stringify () converts the JavaScript object to a string
// received background
String STR = czbg.getStr (); List <the JSONObject> = Object (List <the JSONObject> ) JSONArray.parse (STR); for (the JSONObject obj: Object) { System.out.println (obj.getString ( "key")); // The key value }