日期:2014-05-17  浏览次数:20766 次

import net.sf.json.JSONArray中的jar包无法直接获取JSONArray的length属性,求解
 JSONArray orgJson2= ss.getJSONObject(0).getJSONArray("program"); 
        System.out.println("这里是orgJson2,也就是program的集合值" + orgJson2); 
        JSONArray imgs= orgJson2.getJSONObject(0).getJSONArray("img"); 
    我无法得到imgs的length方法,json 中api明明有个length方法,请问这是为何,jar为

import java.util.Iterator;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

------解决方案--------------------
JSONArray.size() 
这个吧?