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
Explain the selection sort algorithm and state its time complexity?
What is volatile data type?
What is the main use of generics in java?
what do you understand by the term string with respect to java?
Difference between Linked list and Queue?
What is public/private protected in java?
How do you identify independent and dependent variables?
Write a program to find maximum and minimum number in array?
Which programming language is most secure?
What is difference between char array and string?
What are the five major types of reference sources?
What is a singleton factory?
Can arraylist hold different types java?
How do you add an element to a hashset in java?
What is difference between string and new string?