Using the merge method of the Map interface, which statement correctly updates the salesTotalByDept map of type Map<String,Integer> to update the sales total for a dept by an integer sales value?
A) salesTotalByDept.merge(dept, sales,(d,s) -> s + 1) ;
B) sales.merge(salesTotalByDept, dept, (d,s) -> s + sales) ;
C) dept.merge(salesTotalByDept, sales, (d,s) -> s + sales) ;
D) salesTotalByDept.merge(dept, sales, (d,s) -> s + sales) ;
Correct Answer:
Verified
Q73: You intend to use a hash set
Q74: You need to access values in the
Q75: Using the merge method of the Map
Q76: You need to access values in the
Q77: Consider the following code snippet:
Map<String, Integer> scores;
If
Q79: Which of the following statements about stacks
Q80: Which of the following correctly declares a
Q81: Assume that you have declared a queue
Q82: Consider the following code snippet:
Q83: Consider the code snippet shown below:
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents