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 are the two types of java?
Is java a virus?
What is a treemap in java?
Can static methods be inherited?
Why java is made?
What type of value does sizeof return?
How many JVMs can run on a single machine and what is the meaning of Just-In-Time (JIT) compiler?
What is are packages?
What is ide with example?
What is executor memory?
When can an object reference be cast to an interface reference in java programming?
Which sort is best in java?
What is method in java with example?
Why are data types important?
What does this () mean in java?