How will you convert an ArrayList to Arrays?
Answers were Sorted based on User's Feedback
Answer / vikneswarank
Using toArray() method for example
ArrayList arr_obj=new ArrayList()
arr_obj.add("viki");
arr_obj.add("siva");
Object[] obj=arr_obj.toArray();
for further Detail go to my website :
http://www.beexpert.co.in/
| Is This Answer Correct ? | 11 Yes | 2 No |
Using toArray() method for example
ArrayList arr_obj=new ArrayList()
arr_obj.add("viki");
arr_obj.add("siva");
Object[] obj=arr_obj.toArray();
for further Detail go to my website :
http://www.beexpert.co.in/
| Is This Answer Correct ? | 6 Yes | 0 No |
Answer / 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 |
Answer / ramesh
ArrayList arr_obj=new ArrayList()
arr_obj.add("viki");
arr_obj.add("siva");
Object[] obj=arr_obj.toArray();
| Is This Answer Correct ? | 1 Yes | 0 No |
Is char a method in java?
How many inner classes can a class have?
Why do we need hashmap in java?
What is a boolean output?
Which class is the immediate superclass of the Container class?
What is difference between string and new string?
What are the advantages of functions?
What is the method overriding?
how to write a program for chat function using core java
Explain about public and private access specifiers?
What is tcp and udp?
What is a local, member and a class variable?