package arraypkg; import java.util.Arrays; public class Main { private static void foo(Object o[]) { System.out.printf(\"%s\", Arrays.toString(o));
foo({1,2}); doesn't tell what type of array it is. So, compiler fails to understand the syntax. All other declarations specify type of array.
foo({1,2});