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 multi-catch block in java?
What does the “static” keyword mean?
What is a numeric format?
Which of the following classes will have more memory allocated?
What does %4d mean in java?
Can a string be null?
Which methods cannot be overridden in java?
Can I learn java in 3 months?
What are the practical benefits, if any, of importing a specific class rather than an entire package (e.g. Import java.net.* Versus import java.net.socket)?
What is high level language in computer?
What is methods and methodology?
A non-static inner class may have object instances that are associated with instances of the class’s outer class. A static inner class does not have any object instances.
How do you sort arraylist in descending order?
What is a class in java?
Explain the transient field modifier?