Map map = new HashMap(2);
map.add(“1”,”one”);
map.add(“2”,”two”);
map.add(“3”,”three”); What will happen at this line?
Answer Posted / haneef
see, there is no add() in the Map, so u will get compilation
error.
there is only put();
Is This Answer Correct ? | 22 Yes | 0 No |
Post New Answer View All Answers
what is the purpose of the wait(), notify(), and notifyall() methods? : Java thread
Why Do I Get A "permission Denied" Error After Downloading The .jnlp Java Launcher For The Vkvm?
What is the access scope of a protected method?
How does queue work in java?
How many types of classes are there in java?
What is an object class?
What is a parameter in java?
Is there a case when finally will not execute?
What is sorting algorithm in java?
What do you mean by order of precedence and associativity?
Explain about OOPS concepts and fundamentals.
What does super keyword do?
In java, how many ways you can take input from the console?
Can we change the scope of the overridden method in the subclass?
Why is the main method static?