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
Give differences between Quicksort &Mergesort. When should these sorts be used andwhat is their running time in java?
Why enumeration is faster than iterator?
Why declare Main() inside the class in java ?
Which of the following classes will have more memory allocated?
Which is better list or arraylist in java?
What is square root in java?
what is a green thread? : Java thread
What is a function easy definition?
What are the common uses of "this" keyword in java ?
Can a class declared as private be accessed outside it’s package?
What is object class in java?
Howto get an object that will perform date & time calculations then format it for output in some different locales with different date style.can ne1 tel me the answer of this question.pls
For class CFoo { }; what default methods will the compiler generate for you>?
Does java vector allow null?
Why is core java important?