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
Sidana [21]
3 years ago
6

What is the output from the following code? MapInterface m; m = new ArrayListMap(); m.put('D', "dog"); m.put('P', "pig"); m.put(

'C', "cat"); m.put('P', "pet"); System.out.println(m.get('D')); System.out.println(m.get('E')); System.out.println(m.get('P'));
Computers and Technology
1 answer:
Free_Kalibri [48]3 years ago
5 0

Answer: dog

null

pet

Explanation:

taking into condiserations the various animals and their tag given to them;

OUTPUT :

dog

null

pet

PROOF:

Where the Initially map : {}

after map.put('D', "dog"), map : {'D':"dog"}

after map.put('P', "pig"), map : {'D':"dog", 'P':"pig"}

after map.put('C', "cat"), map : {'D':"dog", 'P':"pig", 'C':"cat"}

after map.put('P', "pet"), map : {'D':"dog", 'P':"pet", 'C':"cat"}, what this does is replace the  value of P with "pet"

map.get('D') prints dog.

map.get('E') prints null, key is not present

map.get('P') prints pet

cheers I hope this helped !!

You might be interested in
Which method of traversing a tree would result in a sorted list for a binary search tree?
shutvik [7]

Answer:

The inorder traversal make a binary search tree sorted.

Explanation:

The algorithm of inorder traversal is

1.  Traverse the left subtree.

2.  print the data .

3. Traverse the right subtree

In this algorithm left subtree  is visited first then it print the data or visit the data and finally it visited Right subtree .

6 0
3 years ago
How can we compare a computer with human beings?
LenaWriter [7]

Answer:

Our brain as a central information processor vs. computer having a central processing unit

Our brain takes sensory input → processing/ sense making → in order to produce behavior as output. Computers work similarly: information input → processing → output task

Computers requires both hardware and software to function. Our body is essentially hardware, what we learn from formal education and informal life experiences are software.

Explanation:

8 0
4 years ago
i got a set of headphones and when i plug them into my speakers the right side only works how do i fix the left side of them
Sladkaya [172]
Sorry I don't know what is wrong with your headphones. Maybe try plugging them into something else.
3 0
3 years ago
I am having horrible trouble with deciding if I should get Audacity or Adobe Spark for recording, if someone could help me choos
lbvjy [14]

I haven't really used either, but people I know would prefer using Audacity.

5 0
3 years ago
Read 2 more answers
Brandon purchased a new processor online as an upgrade. When he purchased the processor, he made sure that it used the same sock
LenaWriter [7]

Answer:

The processor and the motherboard goes bad.

Explanation:

Computer system component upgrade allows the enhancement of the component specification. Every computer system comes with a specific quality, size or speed of its various components like the storage drives size, the memory size, the processor speed and even the software components like the operating system.

An upgrade must be compatible with the system configuration like upgrading the processor. If the upgrade is compatible, the processor speed can be increased, but when an upgrade of the processor is not compatible with the chipsets, this could damage the processor and motherboard.

3 0
4 years ago
Other questions:
  • Write three statements to print the first three elements of array runTimes. Follow each statement with a newline. Ex: If runTime
    12·1 answer
  • What kind of device is a printer? output or input
    13·1 answer
  • Write a c++ function, largestnum, that takes as parameters a double array and its size and returns the index of the last occurre
    14·1 answer
  • When a defendant pleads guilty to one offense just to have another offense dropped, this is what type of plea bargain
    12·2 answers
  • If a file's permissions are set to 760, what permission(s) are available to the group assigned to the file?â
    11·1 answer
  • What are the two most common form factors used today for computer cases, power supplies, and motherboards?
    15·1 answer
  • When an Item is base lined, it becomes frozen, here frozenmeans that only creating an old version can change the item
    9·1 answer
  • It is most commonly used for self-running presentations.
    8·1 answer
  • True or False: Reader Accounts are able to extract data from shared data objects for use outside of Snowflake.
    14·1 answer
  • Malware that locks or prevents a device from functioning properly until a fee has been paid is known as:
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!