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 contract between hashcode and equal method?
What are the types of relation?
What is meant by null and void?
What is the return type of the main method?
What do you mean by a JVM?
What is a null class?
What is void class in java?
What is a numeric literal?
What is the use of a copy constructor?
What steps are taken when the OS shifts from one-thread execution to another?
What is an array length?
What is a marker interface?
Is there any difference between synchronized methods and synchronized statements?
Explain the private protected method modifier?
Explain why wait(), notify() and notifyall() methods are in object class rather than in thread class?