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
How to make object serializable in java?
What is api data?
What is module with example?
When wait(), notify(), notifyall() methods are called does it releases the lock or holds the acquired lock?
What is meant by final class?
What is static method with example?
How can we find the sum of two linked lists using stack in java?
What are the types of sockets in java?
I want to print “hello” even before main is executed. How will you acheive that?
What is void keyword?
What is a get method?
What does sizeof return?
What is the use of static methods?
What is a map in java?
Why are global variables used?