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

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

0 Answers  


what is a portable component?

0 Answers  


the advantages of polymorphic

1 Answers  


What is metaspace?

0 Answers  


In HashTable I am storing null value..then what is the error it will show

2 Answers   GM General Motors,


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

2 Answers  


Difference between new operator and class.forname().newinstance()?

0 Answers  


what we can't do in jdbc but can do hibernate?

3 Answers   Cap Gemini,


what are the advantages of JTA over JTS?

0 Answers  


If we opened windows notepad 4 times, does it starts 4 processes or 4 threads?

1 Answers  


How to deploy Jar, War files in J2EE?

0 Answers   HCL,


What do you need to set-up a cluster with jboss?

0 Answers  


Categories