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 |
Difference between DurableSubscription and non- DurableSubscription?
Write a program on RMI and JDBC using StoredProcedure?
What happens when we invoke a thread?s interrupt method while it is in sleeping or waiting condition?
what is difference between checked exception & unchecked exception in java?
What do you know about seam?
What is the diffrence between a local-tx-datasource and a xa-datasource? Can you use transactions in both?
What is the initial state, When a thread is created and started?
What is a convertor?
What are different types of layout managers in java.awt package?
Is the ternary operator written x : y ? Z or x ? Y : z ?
What is a thread?
what is catalina in tomcat server.