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 |
JSP is by default thread safe or not? what is the meaning of isThreadSafe="true" and isThreadSafe="false". Explain it? Thanks, Seenu
Are true and false keywords?
Why isn’t there operator overloading?
use of wrapper classes?
How many types of string data types are there?
Why there are some null interface in JAVA? What does it mean? Give some null interface in JAVA?
How many bits are used to represent unicodde,ASCII,UTF-16 and UTF-8 characters?
How do you add an element to a set in java?
Can java program run without jre?
What are the four versions of java?
What is meant by singleton class?
What happens when you assigned a 'double' value to a 'String'?