Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How will you convert an ArrayList to Arrays?

Answers were Sorted based on User's Feedback



How will you convert an ArrayList to Arrays?..

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

How will you convert an ArrayList to Arrays?..

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

How will you convert an ArrayList to Arrays?..

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

How will you convert an ArrayList to Arrays?..

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

Post New Answer

More Core Java Interview Questions

what is the reason behind non static method cannot be referenced from a static Context?

2 Answers  


What is the right data type to represent a price in java?

0 Answers  


What is a literal coding?

0 Answers  


What is a values collection view ?

0 Answers  


What is the function of log?

0 Answers  


Is it compulsory to have atleast one abstract method in abstract class?

10 Answers  


What is Interface?

8 Answers   BMC,


How can you read content from file in java?

0 Answers   HCL,


how many ways we can serialize the java object?

2 Answers   Satyam,


What are the important features of Java 8 release?

0 Answers  


Is java a security risk?

0 Answers  


What are memory tables?

0 Answers   Aspiring Minds,


Categories