public Object[] toArray(){
  Object[] result=new Object[size];
  System.arraycopy(elementData,0,result,0,size);
  return result;
}

public Object [ ] toArray ( ) { Object [ ] result = new Object [ size ] ; System . arraycopy ( elementData , 0 , result , 0 , size ) ; return result ; }
returns an array containing all of the elements in this list in the correct order .
