i have one arraylist named species containing strings. i need to put the data in to a String array called species_name. how do i do this?
Printable View
i have one arraylist named species containing strings. i need to put the data in to a String array called species_name. how do i do this?
There may be a method for it, check the list and arraylist API for a method that does it. If t doesn't exist you can easily do this by first creating an array of strings equal to the size of the arraylist, then loop through and add items to the array.
the toArray method requires an 'Object' . can i use this method with any modifications in it?
I guess you just skimmed through the API documentation for the ArrayList class, because the answer is right there:
Always first read the API documentation before you start guessing and before you start asking questions here.Quote:
Originally Posted by API
kind regards,
Jos