How to store arrayList into an array in java?
Tell me more
×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
That depends on what you want:
Now if you want to store the list in an array, you can do one of these:
But if you want the list items in an array, do one of these:
Reference: |
|||||||||
|
You mean you want to convert an
Choose the appropriate class. |
|||
|
Or just use List#toArray() |
|||
|
|
|||
|
If Type is known (aka not a generics parameter) and you want an Array of Type:
Otherwise
|
|||
|
Try the generic method
|
|||||
|