Answer Posted / siddpany
class hashMap
{
public static void main(String args[])
{
HashMap map = new HashMap();
map.put("key1",200);
map.put("key1",100);
map.put("key1",400);
map.put("key1",700);
Set set = map.keySet();
//for each loop
for(Object object :set)
{
System.out.println(map.get(Object));
}
| Is This Answer Correct ? | 11 Yes | 4 No |
Post New Answer View All Answers
What does localhost mean?
Difference between serialization and deserialization in java?
Can we synchronize static methods in java?
What is canonical name in java?
Why main method is called first in java?
What are new features introduced with java 8 ?
What is meant by anonymous class?
how are methods defined?
What are the differences between c++ and java?
In a class implementing an interface, can we change the value of any variable defined in the interface?
Does list maintain insertion order java?
What is the difference between sleep and wait in java?
What is jvm? How its run?
What is the difference between Java Program Constructor and Java Program Method, What is the purpose of Java Program constructor Please Explain it Breafily?
Explain java code for recursive solution's base case?