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?

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of :: in java?

956


What is the use of singleton?

904


How many digits can a float hold?

940


What are the differences between include directive and include action?

1078


What are different types of expressions?

1044


Which package has light weight components?

932


What two classes are used to read data only?

1033


What is command line used for?

1046


What is jit and its use?

946


What is an empty class? What functionality does it offer in Java?

1199


How is the marker interface used in Java?

1035


What is stringjoiner ?

907


How do you escape a string?

909


What is the difference between array list and vector in java?

898


Compare overloading and overriding?

953