title: Array won't resize without copyOf()
body: <p>I have a method that's supposed to grow the size of an array by double once it reaches its capacity</p>
  <p>I was trying to find a way to resize it without Arrays.copyOf but rather creating an array that's double the size and storing the original array in the new resized array</p>
  <p><strong>works</strong></p>
  <pre><code>this.capacity = this.capacity * 2;
  this.theData = Arrays.copyOf(this.theData, this.capacity);
  </code></pre>
  <p><strong>doesn't work</strong>
  rather it throws away the first index and replaces it with the new value, without resizing</p>
  <pre><code>double arrayResize[] = new double[this.capacity*2];
  for (int i = 0; i&lt;this.theData.length;i++){
          arrayResize[i] = this.theData[i];
  }
  </code></pre>