Possible Duplicate:
convert String arraylist to string array in java?
Following is my code
ArrayList<String> IdList = new ArrayList<String>();
and I want to copy items from
IDList
to int IdArray[]
.
Following is my code
and I want to copy items from
|
|||||||||
feedback
|
This question covers exactly the same content as earlier questions on this topic; its answers may be merged with another identical question. See the FAQ for guidance on how to improve it.
However, this will probably fail because you're trying to convert a string-arraylist to an int-array.. |
|||
feedback
|
I think you must iterate through all items, which are Strings, and parse each of them into an int to populate your new int[] array. |
|||
feedback
|
|
|||
feedback
|
String [] outStrArray = (String [])IdList.toArray() |
|||
feedback
|
Try this stuff,
|
|||||||||
feedback
|
|
|||
feedback
|