title: How to remove an item from an array at index?
body: <p>Ill try to clarify.</p>
  
  <p>I have:</p>
  
  <pre><code>public static void main(String[] args) {
      int a[] = {5, 6 ,7 ,8 ,9 ,10};
      removeArray takeOff = new removeArray();
      takeOff.remove(3);
  
      for (int i = 0 ; i &lt; a.length ; i++){
          System.out.print(" "+a[i]);
      }
  }
  </code></pre>
  
  <p>That should print out:</p>
  
  <p><code>5, 6, 7, 9, 10.</code></p>
  
  <p>The problem is the remove method, how should I write that. I have:</p>
  
  <p>public class removeArray {</p>
  
  <pre><code>public void remove(int index) {       
  
      if (index &gt; 0) {
          System.arraycopy(testThatArray.a, 0, testThatArray.a, 0, index);
      }
  
      if (index &lt; testThatArray.a.length - 1) {
          System.arraycopy(testThatArray.a, index + 1, testThatArray.a, index, testThatArray.a.length - index - 1);
      }
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Still, no?</p>
  
  <p>UPDATE: 
  I got it to print <code>5 6 7 9 10 10</code>, how can i remove the last value?</p>