Java Programming Fundamentals
Casual Mode - Take your time!
1 / 20
Correct
0
Incorrect
0
Score
0%
Multiple Choice
Which is simplest and correct code snippet needs to be put in the main function to replace the value object of the HashMap for the key “orange”?
- itemMap.remove("orange"); itemMap.put("orange", new Item("Orange") );
- ((Item)itemMap.get(“orange”)).name = “Orange”;
- itemMap.put("orange", new Item("Orange") );
- None of above