title: Arrays.asList() not working as it should?
body: <p>I have a float[] and i would like to get a list with the same elements. I could do the ugly thing of adding them one by one but i wanted to use the Arrays.asList method. There is a problem though. This works:</p>
  
  <pre><code>List&lt;Integer&gt; list = Arrays.asList(1,2,3,4,5);
  </code></pre>
  
  <p>But this does not.</p>
  
  <pre><code>int[] ints = new int[] {1,2,3,4,5};
  List&lt;Integer&gt; list = Arrays.asList(ints);
  </code></pre>
  
  <p>The asList method accepts a varargs parameter which to the extends of my knowledge is a "shorthand" for an array. </p>
  
  <p>Questions:  </p>
  
  <ul>
  <li><p>Why does the second piece of code returns a <code>List&lt;int[]&gt;</code> but not <code>List&lt;int&gt;</code>.</p></li>
  <li><p>Is there a way to correct it?</p></li>
  <li><p>Why doesn't autoboxing work here; i.e. <code>int[]</code> to <code>Integer[]</code>?</p></li>
  </ul>