title: How Arrays.asList(int[]) can return List<int[]>?
body: <p>While doing simple program I noticed this issue.</p>
  
  <pre><code>int[] example = new int[10];
  List&lt;Integer&gt; exampleList = Arrays.asList(example);// Compilation error here  
  </code></pre>
  
  <p>Compilation error is returned as <code>cannot convert from List&lt;int[]&gt; to List&lt;Integer&gt;</code>. But <code>List&lt;int&gt;</code> is not permitted in java so why this kind of compilation error?</p>
  
  <p>I am not questioning about autoboxing here I just wondered how <code>Arrays.asList</code> can return <code>List&lt;int[]&gt;</code>.</p>
  
  <p>asList implementation is </p>
  
  <pre><code>public static &lt;T&gt; List&lt;T&gt; asList(T... a) {
  return new ArrayList&lt;T&gt;(a);
  }
  </code></pre>
  
  <p>So it is treating int[] as T that is why this is happening.</p>