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 difference between thread and runnable types? : Java thread
Where are variables stored?
How to perform selection sort in java?
explain the concept of virtual method invocation in polymorphism in detail?
What do you mean by checked exceptions?
Can classes declared using the abstract keyword cab be instantiated?
What is definition and declaration?
What do you mean by constructor?
How do you remove spaces in java?
What does localhost mean?
What's the difference between an abstract class and interface in java?
What is nextline method in java?
How many bits is a word?
What is early binding and late binding in java?
How many types of voids are there?