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 are the oops concept?
How a component can be placed on Windows?
How is a java object message delivered to a non-java client?
what are getters and setters in Java with examples?
To what value is a variable of the string type automatically initialized?
Can you control when passivation occurs?
What is Remote Server?
Can I use javascript to submit a form?
Brief description about local interfaces?
Explain phantom read?
What are the call back methods in entity bean?
What is table mutation and how do you avoid it?
How would you create a button with rounded edges?
Which javutil classes and interfaces support event handling?
Why are my checkboxes not being set from on to off?