JSONArray ja = new JSONArray();
ja.put("11");
ja.put("22");
ja.put("33"); JSONArray ja2 = new JSONArray();
ja2.put("aa");
ja2.put("bb"); ja.put(ja2); System.out.println(ja.toString());
// jsonarray 这个代表集合 左右两边[]
// ["11","22","33",["aa","bb"]] JSONObject jsonObject = new JSONObject(); try { jsonObject.put("aaa", "111");
jsonObject.put("bbb", "222");
jsonObject.put("ccc", "333");
jsonObject.put("ddd", "444"); } catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} System.out.println(jsonObject.toString());
// jsonObject就是中间有个:号,然后左右两边是{}
// {"ddd":"444","ccc":"333","bbb":"222","aaa":"111"}