Solved

Using the Merge Method of the Map Interface, Which Statement

Question 78

Multiple Choice

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:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents