Varargs to ArrayList problem in Java
问题 I don't understand why the following does not work: public void doSomething(int... args){ List<Integer> broken = new ArrayList<Integer>(Arrays.asList(args)) } Its my understanding that the compiler converts the "int... args" to an array, so the above code should work. Instead of working I get: cannot find symbol symbol: constructor ArrayList(java.util.List <int[] >) location: class java.util.ArrayList <java.lang.Integer > Thats bizarre. I'm not adding an array to array list, I'm adding each