public void ensureCapacity(int mincap){
  if (mincap > array.length) {
    int newcap=((array.length * 3) >> 1) + 1;
    int[] olddata=array;
    array=new int[newcap < mincap ? mincap : newcap];
    System.arraycopy(olddata,0,array,0,size);
  }
}

public void ensureCapacity ( int mincap ) { if ( mincap > array . length ) { int newcap = ( ( array . length * 3 ) > > 1 ) + 1 ; int [ ] olddata = array ; array = new int [ newcap < mincap ? mincap : newcap ] ; System . arraycopy ( olddata , 0 , array , 0 , size ) ; } }
increases the capacity of this arraylist instance , if necessary , to ensure that it can hold at least the number of elements specified by the minimum capacity argument .
