Another good idea typically is to simply look at the source code that is provided with the JDK.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Keep in mind it probably always creates a 1 dimensional array to hold your elements, however it is a shallow copy of the elements themselves. Also, I have some code that converts a ResultSet to an ArrayList and then using toArray I convert the ArrayList to an Object. I time this code with JAMon . It must be very efficient as it is one of the fastest pieces of code that I have performance stats for.
If you look at this report the line 'com.fdsapi.ResultSetUtils.listToObjectArray()' converts from the ArrayList to an array.