The java.lang.reflect.Array class provides static methods to dynamically create and access Java arrays. Any java collection or list can easily be converted into an Object array. There are two method calls, that I preferably squish into one line to get the job done. The first method call is:
The method creates a new array with the specified component type and length. You can also cast down to have returned an array of your specified component type.
The second method call is defined in the java.util.List interface.
The method returns an array containing all of the elements in the List in the correct order where the runtime type of the returned array is that of the specified array.
Coupling the two calls above can allow you to quickly transform your ArrayList of objects into an object array of the specified object's component type.
Have a look at the sample code below for an ArrayList of strings to be converted into a String .
ArrayList theStrings = new ArrayList(); theStrings.add("Hello"); theStrings.add("Aloha"); theStrings.add("Bonjour"); //Return String . String  theStringArray = (String)theStrings.toArray( (String)Array.newInstance(java.lang.String.class, theStrings.size()) );
With one line, you'll be able to turn your list of Java objects into an array of objects of the object's component type.
Questions, just comment and I'll be sure to get back to you.