Question: You have an instance of type Map named instruments containing the following key-value pairs: guitar=1200, cello=3000, and drum=2000. If you add the new key-value pair cello=4500 to the Map using the put method, how many elements do you have in the Map when you call instruments.size()?
- 2
- When calling the put method, Java will throw an exception
- 4
- 3
Answer: The correct answer of the above question is Option D:3