public void add(int index,int element){
  checkRangeIncludingEndpoint(index);
  ensureCapacity(size + 1);
  int numtomove=size - index;
  System.arraycopy(array,index,array,index + 1,numtomove);
  array[index]=element;
  size++;
}

public void add ( int index , int element ) { checkRangeIncludingEndpoint ( index ) ; ensureCapacity ( size + 1 ) ; int numtomove = size - index ; System . arraycopy ( array , index , array , index + 1 , numtomove ) ; array [ index ] = element ; size ++ ; }
inserts the specified element at the specified position in this list . shifts the element currently at that position ( if any ) and any subsequent elements to the right ( adds one to their indices ) .
