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 JNI?
How are the elements of a borderlayout organized?
difference. between List and Set?
2 Answers Campus Interaction, HCL, Infotech,
What is the purpose of the wait() method?
what's the main difference between unix os and linux os?
How will you pass parameters in RMI? Why do you serialize?
Is System.err.println(""Statement"); is execute the output on console . Example: System.err.println("Hello JAVA");
What are the diff types of exception?
What is a session? Can you share a session object between different theads?
Difference between swing and awt?
Explain ioc concept?
What is the difference between ear, jar and war file?