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 is the use of :: in java?
What is the use of singleton?
How many digits can a float hold?
What are the differences between include directive and include action?
What are different types of expressions?
Which package has light weight components?
What two classes are used to read data only?
What is command line used for?
What is jit and its use?
What is an empty class? What functionality does it offer in Java?
How is the marker interface used in Java?
What is stringjoiner ?
How do you escape a string?
What is the difference between array list and vector in java?
Compare overloading and overriding?