Answer Posted / 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 View All Answers
Can you control when passivation occurs?
Which javutil classes and interfaces support event handling?
How are commas used in the intialization and iteration parts of a for statement?
Explain ioc concept?
Can I run seam with jdk 1.4 and earlier?
What do you need to set-up a cluster with jboss?
how to use debug in my elipse to solve problems that exist in my project
What is the difference between the font and fontmetrics classes?
Which characters may be used as the second character of an identifier, but not as the first character of an identifier?
Difference between loadclass and class.forname?
What is the argument type of a programs main() method?
What is the relationship between local interfaces and container-managed relationships?
Is the infobus client side only?
Have you used threads in Servelet?
How to determine SGA site?