Showing posts with label Collection. Show all posts
Showing posts with label Collection. Show all posts

Monday, May 24, 2010

Convert Collection to Array

The following example converts an ArrayList into an array of strings:

    ArrayList al = new ArrayList();
    //Fill the array 
    ...........

    String[] aStrings = (String[]) al.toArray(new String[0]);