为什么这里出错了?
代码如下:------------------------------------------------------------------------
import java.lang.reflect.Array;
import java.util.*;
public class Test12 {
public static void main(String args[]) throws Exception {
int temp[] = { 1, 2, 3 };
int newTemp[]=(int [])arrayInc2(temp, 5);
System.out.print(Arrays.toString(newTemp));
}
public static Object arrayInc2(Object obj, int len) {
Object newO=new Object[len];
int co=Array.getLength(obj);
System.arraycopy(obj, 0, newO, 0, co);
return newO;
}
}