title: ArrayList out of bounds exception
body: <p>I have the following code:</p>
  
  <pre><code>ArrayList&lt;Integer&gt; arr = new ArrayList&lt;Integer&gt;(10);
  arr.set(0,5);
  </code></pre>
  
  <p>I am getting an index out of bounds error, and I don't know why. I have declared the <code>ArrayList</code> of size 10. Why do I get this error?</p>