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

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

0 Answers  


What are the types of data passing mechanisams under JMS specification?

1 Answers  


What is a convertor?

1 Answers   Suzlon,


What is in-memory replication?

0 Answers  


To make an object to begin executing as a separate thread, what method is used?

2 Answers  


To identify IDL language what mapping mechanism is used?

0 Answers  


what are the software's needed to develop advanced java 3 tier application project

1 Answers  


whats is mean by filter?

1 Answers   SolutionNET,


what do u mean by java bean??

2 Answers   ADP,


Is multiple try block is possible in single java Application......

3 Answers  


What are various types of class loaders used by jvm?

0 Answers  


what is the Scope of Final Keyword in Java?

1 Answers   HCL,


Categories