自动包装发生:
(1)int x=0;
Object xx=x;
(2) common(1);
public static void common(Object o) {
}
(3) ArrayList<Integer> arrayList=new ArrayList<Integer>();
arrayList.add(1);
(4)public static void strVars(Object... o)
int[] x = {1,2}; strArray(x) 正确
关于数组
(1)
public static void strArray(Object[] o) {
}
int[] x = {1,2}; strArray(x)错误
int[][] xy =new int[2][2]; strArray(xy) 正确
(2)
public static void strVars(Object... o)
int[] x = {1,2}; strArray(x) 正确