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 is autoboxing and unboxing?
What are inner classes or non static nested classes in java?
Which package is always imported by default?
What is the use of arrays tostring () in java?
Explain about data types?
Where is jre installed?
What are reference variables in java?
What is the difference between preemptive scheduling and time slicing?
What is the size of int in 64-bit jvm?
Can a class have multiple superclasses?
What are the different types of java?
What is initial size of arraylist in java?
How can a gui component handle its own events?
How is hashcode calculated in java?
Explain importance of finally block in java?