How will you convert an ArrayList to Arrays?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are register variables what are the advantages?

682


Explain the difference between hashmap and hashtable in java?

708


Which class is the superclass for every class in java programming?

761


What is the difference between the boolean & operator and the && operator in java programming?

769


What is the indent key?

793


what is the significance of listiterator in java?

805


Explain the transient field modifier?

774


How do you add spaces in java?

738


What is the use of using enum to declare a constant?

778


if u open login & logout ,how can udisplay the timelogin & logout members ?

1950


What is static import?

847


What do you know about the garbage collector in java?

813


What do you understand by an io stream?

797


What is ascii code?

832


What are the drawbacks of reflection?

764