title: Is there a way of setting the size of an arraylist after declaring it?
body: <p>For example, in a traditional array, i would declare an array like this: </p>
  
  <pre><code>int array[];
  </code></pre>
  
  <p>then, i would later initialize it like this</p>
  
  <pre><code>array = new int[1000];
  </code></pre>
  
  <p>in an arraylist i am trying to do the same but I have only been able to initialize it while declaring it like below. </p>
  
  <pre><code>ArrayList&lt;String&gt; array = new ArrayList&lt;&gt;(1000);
  </code></pre>
  
  <p>it's almost the same as </p>
  
  <pre><code>int[] array = new int[10000];
  </code></pre>
  
  <p>So I would like to know if there's a way to initialize an arraylist to for example 1000 after it's been declared in a separate statement.</p>