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 is a parameter in a function?

524


What are green threads in java?

550


can rmi and corba based applications interact ?

658


Which number is denoted by leading zero in java?

800


Difference between throw and throws?

614






Explain illegalmonitorstateexception and when it will be thrown?

602


why are there separate wait and sleep methods? : Java thread

569


What will be the initial value of an object reference which is defined as an instance variable?

627


How will you add panel to a frame?

640


Can you give names of Container classes?

1844


Can main() method in java can return any data?

636


when you will synchronize a piece of your code? : Java thread

525


Why hashset is used in java?

528


Implement a stack with push (), pop() and min() in O(1) time.

622


How can we create a thread in java?

581