public int remove(int index){
  checkRange(index);
  int oldval=array[index];
  int numtomove=size - index - 1;
  if (numtomove > 0) {
    System.arraycopy(array,index + 1,array,index,numtomove);
  }
  size--;
  return oldval;
}

public int remove ( int index ) { checkRange ( index ) ; int oldval = array [ index ] ; int numtomove = size - index - 1 ; if ( numtomove > 0 ) { System . arraycopy ( array , index + 1 , array , index , numtomove ) ; } size -- ; return oldval ; }
removes the element at the specified position in this list . shifts any subsequent elements to the left ( subtracts one from their indices ) .
