下面就是一个json对象:JSONObject
JSONObject param =
{
"service_code": "test",
"service": [
{
"info": {
"dept_code": "",
"dept_name": ""
}
}
]
}
JSONObject里的service是一个JSONArray
JSONArray service = param.getJSONArray("service");
如果要取service里的info,则
for (int i = 0; i < service.size(); i++) {
JSONObject info = (JSONObject) service.getJSONObject(i).getJSONObject("info");
}