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 do you iterate in Hashmap?



How do you iterate in Hashmap?..

Answer / varun

HashMap<String, String> loans = new HashMap<String, String>();
loans.put("home loan", "citibank");
loans.put("personal loan", "Wells Fargo");

for (String key : loans.keySet()) {
System.out.println("------------------------------------------------");
System.out.println("Iterating or looping map using java5 foreach loop");
System.out.println("key: " + key + " value: " + loans.get(key));
}

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Advanced Java Interview Questions

how we can implement interface in jsp ?

2 Answers   Google,


how team leaders assign work for the team member like through papers,word document

1 Answers   TCS,


which of the following authentication is stronger than the others? a. Http Basic b. Http DIGEST c. Form based

1 Answers  


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

0 Answers  


What is the difference between java class and bean?

0 Answers  


If your ui seems to freeze periodically, what might be a likely reason?

0 Answers  


What are the different types of exception?

0 Answers  


What do you mean by Socket Programming?

0 Answers  


What is ioc concept?

0 Answers  


Why doesn’t the focus feature on the tag work in every circumstance?

0 Answers  


What is message driven beam?

0 Answers  


What restrictions are placed on the location of a package statement within a source code file?

0 Answers  


Categories