class VarArgs {
public static void printArray(Object... args) {
for (Object obj : args)
System.out.print(obj + " ");
System.out.println();
}
public static void main(String[] args) {
printArray( new Integer[] { 1, 2, 3 });
}
}
控制台的输出是:
[Ljava.lang.Integer;@1888759
只想知道这个输出是什么。假定的铸造是通过 Object[] 并给出 1,2,3 作为输出,但是当我使用 Object 进行铸造时,我得到了这个输出