【发布时间】:2015-08-23 17:58:40
【问题描述】:
好的,所以我正在尝试通过反射获得int[] 的值,但它一直很糟糕。这是我的代码:
我想要获得的价值
public int[] blah;
for(Field f : c.getDeclaredFields()) {
f.setAccessible(true);
if(f.getName().toLowerCase().contains("blah")) {
Logger.write("Name: "+f.getName() +" Value:"+Array.get(f, 1));
}
}
无论我做什么,我都会不断收到“blah is not an array”。
【问题讨论】:
标签: java arrays reflection int