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 |
Which container method is used to cause a container to be laid out and redisplayed?
what is a portable component?
the advantages of polymorphic
What is metaspace?
In HashTable I am storing null value..then what is the error it will show
To make an object to begin executing as a separate thread, what method is used?
Difference between new operator and class.forname().newinstance()?
what we can't do in jdbc but can do hibernate?
what are the advantages of JTA over JTS?
If we opened windows notepad 4 times, does it starts 4 processes or 4 threads?
How to deploy Jar, War files in J2EE?
What do you need to set-up a cluster with jboss?