Question: Examine the following code: Map items = new HashMap < > ( ) ; items.put ( Integer . valueOf ( 1 ) , Tea )
Examine the following code:
Map items new HashMap;
items.putIntegervalueOf"Tea";
items.putIntegervalueOf"Cake";
Which statements are true? Choose two
items.putIntegervalueOf"Cake"; will create an additional element with a "Cake" value.
items.putIntegervalueOf"Coffee"; will replace "Tea" with "Coffee."
items.putIntegervalueOf"Cake"; will throw an exception.
items.putIntegervalueOf"Tea"; will replace the integer key value for the "Tea" element.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
