public void trimToSize(){
  if (size < array.length) {
    int[] olddata=array;
    array=new int[size];
    System.arraycopy(olddata,0,array,0,size);
  }
}

public void trimToSize ( ) { if ( size < array . length ) { int [ ] olddata = array ; array = new int [ size ] ; System . arraycopy ( olddata , 0 , array , 0 , size ) ; } }
trims the capacity of this instance to be the list ' s current size . an application can use this operation to minimize the storage of some instance .
