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 to iterate map in collection framework?

Answer Posted / navin kumar

Map<String,String> map = new HashMap<String,String>();
map.put("A","Rohan");
map.put("C","Sohan");
map.put("B","Ram");

for(String key : map.entrySet()){
sop(key);//A,C and B as key
sop(map.get(key))//Rohan,Sohan and Ram as values
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Under what circumstances would von use a while statement rather than for?

759


What is the relation between rss and xml?

820


Do I have to use jsps with my application?

977


do you prefer to work in a small, medium or large company?

1087


In what ways you would know whether a system is unicode or non-unicode?

938


how to configure test cases in ue confermence testing

3031


How many rows can xlsx handle?

588


Tell me why might quick sort might be better than merge sort?

871


Explain the types of string comparision function in PHP

899


What do you understand by blue prism process template?

394


How to add new elements dynamically?

929


How do I get to the boot menu in ubuntu?

706


How do I control what happens when I start ms word?

527


what is asymmetric clustering in web-sphere?

942


What is the difference between *p++ and (*p)++ ?

1293