//關於java map與JSONObject類互相轉換
Map<String,Object> map=new HashMap<String,Object>();
map.put("zhang",1);
List<String> list=new LinkedList<String>();
list.add("zhang");
list.add("zhang");
list.add("zhang");
map.put("ss",list);
JSONObject obj=JSONObject.fromObject(map);
System.out.println(obj.toString());
// JSONArray 與java list array 的互轉
JSONArray jsonarray=JSONArray.fromObject(list);
System.out.println(jsonarray.toString());