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
Maru [420]
3 years ago
8

The following method is intended to remove all values from the ArrayList a that have the same value as val; however, this method

does not work correctly.public void removeValue(ArrayList a, int val) {int i;for (i = 0; i < a.size(); i++) {if (a.get(i) == val) {a.remove(i);}}}If the a contains 2 3 4 3 3 4 4 5 4 3 2 1 and val is equal to 4, then a should contain 2 3 3 3 5 3 2 1 after removeValue is invoked. What does a actually contain after removeValue is invoked? (2 points)1) 2 3 3 4 4 5 4 3 2 12) 2 3 3 3 4 5 3 2 13) 2 4 3 4 5 4 2 14) 2 3 3 3 5 3 2 15) 2 4 3 4 4 5 3 2 1
Computers and Technology
1 answer:
Alona [7]3 years ago
6 0

Answer:

ArrayList a contains [2, 3, 3, 3, 4, 5, 3, 2, 1]

Explanation:

Given

The removeValue method

Required

The content of ArrayList a, after the method is called

From the question, we understand that arraylist a is:

a= [2, 3, 4, 3, 3, 4, 4, 5, 4, 3, 2, 1]

val =4

The function fails when the value to be removed appear consecutively in the list.

4 appears in index 5 and 6 of the list. Only one of the 4's will be removed

So, the updated list will be: [2, 3, 3, 3, 4, 5, 3, 2, 1]

You might be interested in
What is HTML ? <br>Give a small description about html
Genrish500 [490]
Hypertext Markup Language, a standardized system for tagging text files to achieve font, colour, graphic, and hyperlink effects on World Wide Web pages.
this information was taken from google
7 0
2 years ago
Read 2 more answers
When trying to remember a list of words, a person may choose a word to which they "hang" their memories on. This type of mnemoni
nika2105 [10]

Answer:

Peg

Explanation:

This is known as the "peg technique." The name comes from the fact that we usually employ pegs to hang clothes to dry. In this memory aid, the person who wants to memorize something creates mental associations between two concrete objects. This is done in a one-to-one fashion that links all the words together.

6 0
3 years ago
24
gogolik [260]

Answer:

OC

Explanation:

I am not so sure about this though as I am not familiar with a webmail service. I hope this helped. Sorry, if it wasn't much of an help though

7 0
2 years ago
Read 2 more answers
Write a Python statement that displays the value referenced by the number variable formatted as1,234,567.5
bulgar [2K]

Answer:

x = 1234567.5

print(f'{x:,}')

* there's various ways to accomplish this, but above seems to be the shortest. Requires python ≥ 3.6

8 0
2 years ago
Patrick wants you to repair his laptop LCD screen. Patrick insists that it was not his fault, but sometime during the night, the
Dafna1 [17]

Answer:

These are for the WiFi. On a few cards, the Bluetooth facility is being provided through the second antenna, and that is 2.4 GHz, and hence both the antennas are the same in length. And the 5 GHz comes with the wavelength which is half of that of 2.4 GHz, and this is you can use both the antennas for any out of the two frequencies and you can connect to only one Wi-Fi network at one time, however, it needs the second antenna to communicate with any device which is of type Bluetooth, and two at a time.

Explanation:

The answer is self explanatory.

5 0
3 years ago
Other questions:
  • What is an examlple of cyberbullying
    5·1 answer
  • To use a stored address, C provides us with an indirection operator, ____.
    6·1 answer
  • Given two double variables, best value and second best value, write some code that swaps their values. declare any additional va
    13·1 answer
  • Write an if-else statement to describe an object. Print "Balloon" if isBalloon is true and isRed is false. Print "Red balloon" i
    9·1 answer
  • Create a datafile called superheroes.dat using any text-based editor, and enter at least three records storing superheroes’ name
    9·1 answer
  • Write a program in python to test if given number is prime or not.
    6·2 answers
  • Light the<br> Spark hop<br> Answer if ur a baddie;)))
    9·2 answers
  • Technician A says that reprogramming a PCM using the J2534 system requires a factory scan tool, while Technician B says it requi
    14·1 answer
  • What are the differences between a cursor, insertion point and mouse pointer?​
    14·1 answer
  • A program that organizes sequences of automated provisioning tasks. A. Application Packager B. Sequence Manager C. Sequence Logg
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!