标签:
JSON 轻量级的数据交换语言
JSON:{“name”:“zs”,"age":20,"gender":"m","aihao":["0","a","."],"married":false,"school":{”name":"tarena","loc":"bj"}};
String str={“name”:“zs”,"age":20,"gender":"m","aihao":["0","a","."],"married":false,"school":{”name":"tarena","loc":"bj"}};
JSONObject obj=new JSONObject(str);
String name=obj.getString("name");
int age=obj.getInt("age");
boolean m=obj.getBoolean("married");
JSONArray ary=obj.getJSONArray("aihao");
JSONObject o2=obj.getJSONOjbject("school");
02.getString("name");
obj.getJSONObject("school").getString("loc");
标签:
原文地址:http://www.cnblogs.com/gentspy/p/5248039.html