Returns an array containing all of the elements in this collection whose runtime type is that of the specified array. If the collection fits in the specified array, it is returned therein. Otherwise, a new array is allocated with the runtime type of the specified array and the size of this collection. Ragu
Joined: Apr 14, 2001
I read the help from API, but am not still clear. Can someone give an example.
the argument just specifies of which type the returned array should be. Then we just cast the result into what we want. ArrayStoreException may get thrown if the type you specify (new String) is not compatible with the object in the collection. Val