我有這個投原始數組對象和背部
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。我必須在我的數組中使用原始類型。
爲什麼你需要這個? – 2011-03-09 21:30:55