How will you convert an ArrayList to Arrays?

Answer Posted / tapan kumar kundu

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the class in java?

777


Can we override private method?

829


Why is string class considered immutable?

824


Explain about arraylist?

799


Why hashset is used in java?

763


What about member inner classes?

879


What is the difference between double and float variables in java?

870


What is the difference between serial and throughput garbage collector?

808


explain autoboxing in java?

791


If a class is declared without any access modifiers, where can the class be accessed?

820


Is map sorted in java?

832


How do you override a method?

748


Why stringbuilder is not thread safe in java?

809


What is the meaning of flag day?

760


What does null mean in java?

850