This Java Tutorial section we demonstrates how to convert the Java arraylist into the string array
This Java Tutorial section we demonstrates how to convert the Java arraylist into the string array
import java.util.*; public class List1 { public static void main(String[] args) { String ar[]={"cat","dog","rat","elephant"}; String ar2[]=new String[4]; ArrayList list=new ArrayList(); list.add(ar[0]); list.add(ar[1]); list.add(ar[2]); list.add(ar[3]); Object obj[]=list.toArray(); for(int x=0;x