日期:2014-05-16 浏览次数:20451 次
如JSON格式字符串为String rowidString="[{\"kl_id\":\"2\",\"kl_title\":\"Test date\",\"kl_content\":\"Test date\",\"kl_type\":\"1\",\"id\":\"1\"},{\"kl_id\":\"2\",\"kl_title\":\"Test\",\"kl_content\":\"Test\",\"kl_type\":\"1\",\"id\":\"2\"}]";
?
?
JAVA解析代码为:
JSONArray array = JSONArray.fromObject(rowidString);
Object[] obj = new Object[array.size()]; ?
for(int i = 0; i < array.size(); i++){ ? ??
?JSONObject jsonObject = array.getJSONObject(i); ??
?
?? ? ? ? ? ? System.out.println(jsonObject.get("kl_id"));?
?
}
?