title: What's meant by parameter (int initial capacity) in an arraylist
body: <p>What's meant by parameter <code>(int initialCapacity)</code> in an <code>ArrayList</code>, I thought it's the number of elements but it didn't work when I did this:</p>
  
  <pre><code>public class MyClass {
      private ArrayList&lt;Integer&gt; arr;
      public MyClass(int n_elements) {
          arr = new ArrayList&lt;Integer&gt;(n_elements);
      }
  }
  </code></pre>