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 a modifier?
What is package private scope in java?
Name the components that are termed to be Heavy-weight component but available in Light-weight components?
What do you mean by a JVM?
Can we create object of inner class in java?
What are different access specifiers in java?
Explain the concept of proper inheritance?
Is hashset ordered?
What is boolean used for?
Is null == null in java?
what do you understand by synchronization? : Java thread
How do you make a thread in java?
How does thread synchronization occurs inside a monitor?
Which is bigger float or double java?
What is starvation?