ArrayList to Array of Strings in java

Posted by rajivpradeep on Stack Overflow See other posts from Stack Overflow or by rajivpradeep
Published on 2011-03-05T07:07:54Z Indexed on 2011/03/05 7:24 UTC
Read the original article Hit count: 117

Filed under:
|
ArrayList<String> newArray = new ArrayList<String>();
    newArray = urlList.getUrl();
    for( int i = 0 ; i < newArray.size();i++)
    {
        System.out.println(newArray.get(i));
    }

    newArray.toArray(mStrings );// is this correct 
    mStrings = newArray.toArray();//  or this to convert ArrayList ot String array here

    for( int i = 0 ; i < mStrings.length;i++)
    {
        System.out.println(mStrings[i]);
    }

© Stack Overflow or respective owner

Related posts about java

Related posts about android