标签:data rom json.js array message jpg int name system
1 String json = "[{code:0,message:\‘success or error\‘,id:\"0001\",name:\"pic.jpg\"},{code:0,message:\‘success or error\‘,id:\"0001\",name:\"pic.jpg\"},{code:0,message:\‘success or error\‘,id:\"0001\",name:\"pic.jpg\"}]"; 2 net.sf.json.JSONArray jsonArr = net.sf.json.JSONArray.fromObject(jsonData); 3 for(int i=0;i<jsonArr.size();i++){ 4 net.sf.json.JSONObject job = jsonArr.getJSONObject(i); // 遍历 jsonarray 数组,把每一个对象转成 json 对象 5 System.out.println(job.get("name")); 6 System.out.println(job.get("url"));
}
标签:data rom json.js array message jpg int name system
原文地址:http://www.cnblogs.com/zjiacun/p/6728900.html