ArrayList to Array of Strings in java

前端 未结 5 1695
一向
一向 2021-02-05 11:53
ArrayList newArray = new ArrayList();
newArray = urlList.getUrl();
for( int i = 0 ; i < newArray.size();i++)
{
    System.out.println(newA         


        
5条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-05 12:09

    How about this

     List a = new ArrayList();
       a.add("wer");
       a.add("sff");
       String[] f= (String[]) a.toArray(new String[0]);
       System.out.println(f[0]);
    

提交回复
热议问题