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 a modifier?

1439


What is package private scope in java?

889


Name the components that are termed to be Heavy-weight component but available in Light-weight components?

2452


What do you mean by a JVM?

1157


Can we create object of inner class in java?

889


What are different access specifiers in java?

956


Explain the concept of proper inheritance?

1017


Is hashset ordered?

989


What is boolean used for?

991


Is null == null in java?

1040


what do you understand by synchronization? : Java thread

943


How do you make a thread in java?

1036


How does thread synchronization occurs inside a monitor?

1056


Which is bigger float or double java?

928


What is starvation?

1229