Check the
java api
doc
Object[] toArray()
Returns an array containing all of the elements in this list in proper sequence.
Object[] toArray(Object[] a)
Returns an array containing all of the elements in this list in proper sequence; the runtime type of the returned array is that of the specified array.