1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Alisiya [41]
3 years ago
7

Using the merge method of the Map interface, which statement correctly updates the salesTotalByDept map of type Map to update th

e sales total for a dept by an integer sales value? Question 3 options: salesTotalByDept.merge(dept, sales,(d,s) -> s + 1); sales.merge(salesTotalByDept, dept, (d,s) -> s + sales); dept.merge(salesTotalByDept, sales, (d,s) -> s + sales); salesTotalByDept.merge(dept, sales, (d,s) -> s + sales);
Computers and Technology
1 answer:
Alexxandr [17]3 years ago
7 0

Answer:

salesTotalByDept.merge(dept, sales, (d,s) -> s + sales);

Explanation:

In the above statement merge() method is being used which updates the salesTotalByDept map of type Map to update the sales total for a dept by an integer sales value.

Here dept and sales both are used and passed as a parameter to merge() method because salesTotalByDept can be update if both the information about sales and department are provided.

Map.merge() method is used to place new value under the given key if the key does not correspond to any value, or is used to update existing key with a given value.

You might be interested in
Give two separate print statements: one will print your name, the other will print your major. Ensure that both will print on th
Alexus [3.1K]

Answer:

// here is code in java.

// import package

import java.util.*;

// class definition

class Main

{

   // main method of the class

public static void main (String[] args) throws java.lang.Exception

{

   try{

      // print the name

       System.out.print("my name is Sam. ");

       // print the major

       System.out.print("my major is CS.");

   }catch(Exception ex){

       return;}

}

}

Explanation:

In java, System.out.print() will print the statement but didn't go to the next line.If there is another System.out.print(), then it will also print into the same line.So here first the System.out.print() will print the name and second will print the major in the same line.

Output:

my name is Sam. my major is CS.

4 0
3 years ago
Which best describe a resource each student could use to find information
marta [7]

Online library resources

Explanation

Students can utilize online library resources from various campus available for online educational uses.In the library, information on current research in the various displines can be obtained through a search on the book, journal or document.In addition to that, goggle offers academic journals and academic documents prepared by scholars for other academicians to read and get information.

8 0
3 years ago
Read 2 more answers
What does pagination mean in Microsoft Word?
marin [14]

it means to alt f4 then that would help so it can eat the microscope then have it digested

5 0
3 years ago
Read 2 more answers
Which of the following statements are true?
grin007 [14]

Answer:

I think the answer are two which are B and C

7 0
3 years ago
I want to know all the part of computer system
Effectus [21]
There are alot of parts in a computer system. You have to be a little specific
4 0
3 years ago
Other questions:
  • Which of these statements is true?
    9·1 answer
  • âwhat two log files are used by older versions of unix and newer version of linux to store log information
    10·2 answers
  • Computer programmers often use binary codes (strings of 1s and 0s) to write programs for computers. These codes are then changed
    6·1 answer
  • Write a program that generates a random number between 5 and 15 and asks the user to guess what the number is. If the user’s gue
    5·1 answer
  • Assume the availability of a function named oneMore. This function receives an integer and returns one more than its parameter.
    14·1 answer
  • Computer can do work very___​
    7·2 answers
  • Universal Containers uses a custom object within the product development team. Product development, executives, and System Admin
    11·1 answer
  • I have a problem with my Nintendo DS lite does anyone know how to fix it?
    8·1 answer
  • Another way to create a new presentation is from the Home tab
    6·2 answers
  • Give an example of how loops are used in programming Kturtle​
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!