Possible Duplicate:
How to store arrayList into an array in java?
I want to know how can I convert an ArrayList into an Array.
Is there any method to do so in Java?
Can anyone help me about this?
Possible Duplicate:
How to store arrayList into an array in java?
I want to know how can I convert an ArrayList into an Array.
Is there any method to do so in Java?
Can anyone help me about this?
yep, there is check out the List API:
Example:
List<Integer> list = new ArrayList<>();
list.add(1);
list.add(2);
list.add(3);
Integer[] arr = list.toArray(new Integer[list.size()]);