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 |
In HashTable I am storing null value..then what is the error it will show
What is local interface. How values will be passed?
What is synchronization?
What event results from the clicking of a button?
What’s jboss cache in short?
Can we define constructors in Servlet?
3 Answers Accenture, Opus, Wipro,
difference between applicationserver and webserver
Why are my checkboxes not being set from on to off?
How are the elements of a cardlayout organized?
How u validate date in DD/MM/YY format. and how u validate money in ur jsp
3 Answers Ashok Leyland, Satyam, Tech Mahindra, Tomax,
What are the sequence of steps to write pub or sub model kind of application?
To what value is a variable of the string type automatically initialized?