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
Which method must be implemented by all threads?
What is indexof?
What is the purpose of the enableevents() method in java programming?
Can a singleton class be inherited?
Is singleton a bad practice?
State some situations where exceptions may arise in java?
Explain the scope of a variable.
what is the messsage u r going to get from an objectoriented programing?
What is a short in java?
What is java and their uses?
Why declare Main() method as a static in java ?
Does sprintf allocate memory?
What is a generic code?
What classes of exceptions may be thrown by a throw statement?
What is jvm? Why is java called the platform independent programming language?