【发布时间】:2011-03-09 21:28:52
【问题描述】:
我有这个
int [] abc = new int[30];
Object arr = abc;
我如何将arr 转换回int[] ??即
int [] foo = (int[])arr
另外,如果arr可以指向int[]或byte[],如何区分它们??
我检查了arr.getClass().getName() 返回[I 和arr.getClass().isPrimitive() 是false。一定是另一种检测方式吗?
谢谢。
PS。我必须在我的数组中使用原始类型。
【问题讨论】: