您的位置:首页 > 编程语言 > Java开发

java_不知道数据类型情况下,数组遍历-反射

2014-01-05 18:12 525 查看
if(items.getClass().isArray){
this.collection = new ArrayList();
int length = Array.getLength(items);
for(int i=0;i<length;i++){
Object value = Array.get(items,i);
this.collection.add(value);
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  java
相关文章推荐