title: Is there any way to copy an array to the same array with less number of elements
body: <p>I have an array with 8 elements, and I need to remove the first element from it and copy it to the same array. I tried it using System.arraycopy(...) but the size of the array did not change.</p>
  
  <pre><code>int[] array = {90,78,67,56,45,34,32,31};
  System.arraycopy(array, 1, array, 0, array.length-1);
  </code></pre>
  
  <p>what I need is, the array should consist 78,67,56,45,34,32,31 elements with the array size of 7</p>
  
  <p>there is a way to do this by copying this to another array and assigning it to the first array</p>
  
  <pre><code>int arrayB = new int[array.length-1];
  System.arraycopy(array, 1, arrayB, 0, array.length-1);
  array = arrayB;
  </code></pre>
  
  <p>but this is not the way I want. I need it to be done without the help of another array.</p>