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 java’s garbage collected heap?
Explain different ways of creating a thread. Which one would you prefer and why?
Write a program in java to create a doubly linked list containing n nodes.
I am unable to find or learn about print command. I have a graphical program in core java in applet but i want to give print command but i have coding for that so if anyone know about this plz mail me on avdhesh_chauhan007@yahoo.co.in
How do you clear an arraylist in java?
Given a singly linked list, find the middle of the list in a single traversal without using temporary variable.
Can we override static methods in java?
What do the thread?class methods run() and start() do?
What are latest features introduced with java 8?
what is the role of xml in core java?? and how we can use it?? can somebody give a sample program with explanation and from where i can read more about xml?????
What is data movement?
What do you mean by singleton class in java?
What is anti pattern in cyber security?
Difference between error and exception
what is aggregation in java?