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
How will you initialize an Applet?
What's the purpose of using break in each case of switch statement?
What is a char in java?
What are 4 pillers of object orinted programming?
Explain different types of wrapper classes in java?
What access modifiers can be used for variables?
Assume a thread has lock on it, calling sleep() method on that thread will release the lock?
What do you know about the garbate collector?
Java.util.regex consists of which classes?
Is string a class in java?
Why pass by reference is not possible in java?
Can we use static class instead of singleton?
Explain about the main() method in java?
What is the difference between serializable and externalizable interface?
What are different data types?