Example of Java Arraylist to Array
import java.util.ArrayList;
public class List1 {
public static void main(String[] args) {
int ar[]={444,222,333,111};
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(Object x:obj)
{
System.out.println((Integer)x-1);
}
}
}
Output
443
221
332
110
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.