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 |
What is the return type of interrupt method?
what is the proxy pattern?
Name three subclasses of the component class?
What is the difference between RMI and Corba?
What are synchronized methods and synchronized statements?
What is ripple effect?
what is an isolation level?
What is the difference between the session.update() method and the session.lock() method?
What is prototype?
whether the connectionpooling used in struts?
Explain the different types of memory used by jvm?
what is a dirty read?