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 copy the hashmap object into arraylist at java program?

Answer Posted / abhinaw

HashMap hm = new HashMap();
hm.put("1", "a1");
hm.put("2", "a2");
hm.put("3", "a3");
hm.put("4", "a4");
hm.put("5", "a5");

ArrayList list = new ArrayList();
list.addAll(hm.entrySet());
System.out.println(list);

Is This Answer Correct ?    4 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Using callable statement how can you pass out parameters, explain with example?

1181


How does map works in java?

950


Which container method is used to cause a container to be laid out and redisplayed in java programming?

1066


Can constructor be static or final?

1053


How many ways can we create the string object?

973


java Technical questions asked by JPMC

5012


What is composition in java?

1241


What are access specifiers available in java?

984


What if I write static public void instead of public static void in java?

1051


How to create packages in java?

905


Is char a data type in java?

925


What happens if an exception is not handled in a program?

1063


Why array is used in java?

935


Is an object null?

921


What is the difference between variable declaration and variable initialization?

997