title: Java ArrayList for integers
body: <p>I have values that I'd like to add into an ArrayList to keep track of what numbers have shown up.
  The values are integers so I created an ArrayList;</p>
  
  <pre><code>ArrayList&lt;Integer[]&gt; list = new ArrayList&lt;&gt;();
  int x = 5
  list.add(x);
  </code></pre>
  
  <p>But I'm unable to add anything to the ArrayList using this method.
  It works if I use Strings for the array list. Would I have to make it a String array and then somehow convert the array to integers? </p>
  
  <p>EDIT: I have another question. I'd like the list to only hold 3 values. How would I do so? </p>