title: Varargs to ArrayList problem in Java
body: <p>I don't understand why the following does not work:</p>
  
  <pre><code>public void doSomething(int... args){
    List&lt;Integer&gt; broken = new ArrayList&lt;Integer&gt;(Arrays.asList(args))
  }
  </code></pre>
  
  <p>Its my understanding that the compiler converts the "int... args" to an array, so the above code should work.</p>
  
  <p>Instead of working I get:</p>
  
  <blockquote>
    <p>cannot find symbol
    symbol:   constructor ArrayList(java.util.List<code>&lt;int[]</code>>)
    location: class java.util.ArrayList<code>&lt;java.lang.Integer</code>></p>
  </blockquote>
  
  <p>Thats bizarre. I'm not adding an array to array list, I'm adding each element from the list to the arraylist. Whats going on?</p>