Answer Posted / vikas
using toArray() method.
example:
ArrayList<Integer> al = new ArrayList<Integer>();
al.add(1);
al.add(5);
al.add(8);
al.add(10);
//Get the array
Integer tempArray = new Integer[al.size()];
tempArray = al.toArray(tempArray);
Is This Answer Correct ? | 7 Yes | 1 No |
Post New Answer View All Answers
Why destructor is not used in java?
Explain the difference between throw and throws in java?
What is data member in java?
What is difference between classpath and path variables in java?
What is main method?
What is the point of polymorphism java?
Is null a string?
What is the difference between keyword and identifier?
How do you reverse sort a list in java?
What are the three types of design patterns?
How do you clear an arraylist in java?
What is files manifesting?
Is main is a keyword?
What is the difference between the paint() and repaint() methods in java programming?
How do you sort in ascending order in java?