title: Populate an ArrayList with for loop
body: <p>I am trying to populate an <code>ArrayList</code> using a loop. What am I doing wrong? When I print the <code>ArrayList</code> nothing gets printed. I think my problem is related to <code>numbers.size()</code>.</p>
  
  <pre><code>ArrayList&lt;Integer&gt; numbers = new ArrayList&lt;&gt;(7);
  for (int i = 1; i &lt;= numbers.size(); i++) {
      numbers.add(i);
  }
  </code></pre>