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 are different data types?

1015


Can a source file contain more than one class declaration?

957


What is the difference between math floor and math round?

1028


What is super in java?

979


What is command line argument

1184


What is e in java?

951


What is downcasting?

1093


How many types of design patterns are there?

1093


What are alternatives to java serialization?

1108


How do you sort arrays in java?

916


Why is it called buffering?

1109


What is the numeric promotion?

1012


Define Multiprogramming and Multiprocessing in java.

1133


What is difference between wait and notify in java?

1124


What is meant by javabeans?

1084