Return to Snippet

Revision: 41850
at February 24, 2011 00:19 by BenClayton


Initial Code
ArrayList<String> strList = new ArrayList<String>();
String[] strArray = strList.toArray(new String[0]);

Initial URL


Initial Description
This works for types other than string, of course. Don't try to use the .toArray() method without params and cast.

Initial Title
Java: Convert ArrayList to Array.

Initial Tags


Initial Language
Java