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
Can we override private constructor in java?
What are the practical benefits, if any, of importing a specific class rather than an entire package (e.g. Import java.net.* Versus import java.net.socket)?
Which of the following classes will have more memory allocated?
What is the difference between serial and throughput garbage collector?
What is ph and buffers?
How are multiple inheritances done in Java?
What are the methods available in a class?
What is r * in math?
Can we extend a class with private constructor?
Is null an object java?
What is stringbuffer in java?
What is composition in java?
Is empty set an element of empty set?
What is boolean query?
Write a factorial program using recursion in java?