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
What are different data types?
Can a source file contain more than one class declaration?
What is the difference between math floor and math round?
What is super in java?
What is command line argument
What is e in java?
What is downcasting?
How many types of design patterns are there?
What are alternatives to java serialization?
How do you sort arrays in java?
Why is it called buffering?
What is the numeric promotion?
Define Multiprogramming and Multiprocessing in java.
What is difference between wait and notify in java?
What is meant by javabeans?