title: Why can't I have 'int' as the type of an ArrayList?
body: <p>I want to declare an <code>ArrayList</code> of type <code>int</code>.</p>
  
  <p>Why does the following give me an error:</p>
  
  <pre><code>ArrayList&lt;int&gt; list1 = new ArrayList&lt;int&gt;();
  </code></pre>
  
  <p>But the following works: </p>
  
  <pre><code>ArrayList&lt;Integer&gt; list1 = new ArrayList&lt;Integer&gt;();
  </code></pre>
  
  <p>?</p>