更新时间:2022-01-02 05:06:18
显然, org.json.simple.JSONArray
实现了原始 Iterator。这意味着每个元素都被认为是 Object
。您可以尝试强制转换:
Apparently, org.json.simple.JSONArray
implements a raw Iterator. This means that each element is considered to be an Object
. You can try to cast:
for(Object o: arr){
if ( o instanceof JSONObject ) {
parse((JSONObject)o);
}
}
这就是Java 1.4中的事情。早些时候。
This is how things were done back in Java 1.4 and earlier.