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
What modifiers may be used with an interface declaration?
What is JTS?
What are JTA/JTS and how they used by client?
When a thread blocks on i/o, what state does it enter?
What is a sessionfactory? Is it a thread-safe object?
Describe, in general, how java's garbage collector works?
What state does a thread enter when it terminates its processing?
For which statements does it make sense to use a label?
What class is the top of the awt event hierarchy?
which type of objects reference will be given to client?
What is clustering? What are the different algorithms used for clustering?
Where can I ask questions and make suggestions about seam?
What is in-memory replication?
What is ioc concept & explain it?
What is the difference between the ‘font’ and ‘fontmetrics’ class?