subject

Consider the following method intended to modify the parameter names by removing all instances of the string n.

public static void removenames (arraylist names, string n) { for (/* missing code */) { if (names. get(i).equals(n)) { names. remove(i); } } }

which of the following could correctly replace /* missing code */ so that removenames works as intended?

int i = 0; i < names. size(); i--

int i = names. size() - 1; i > = 9; i++

int i = 0; i < names. size(); i++

int i = names. size() - 1; i > =0; i--

none of the above. the code has an error.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 00:00
Sam is a data analyst at an advertising firm. he often uses a spreadsheet that contains media ratings details. he would like to filter the spreadsheet data based on different filter criteria. which operators can he use to specify the combination of filter criteria? sam can use the ( blank ) operators to specify a combination of filter criteria.
Answers: 3
question
Computers and Technology, 24.06.2019 08:00
Can someone work out the answer as it comes up in one of my computer science exams and i don't understand the cryptovariables
Answers: 1
question
Computers and Technology, 25.06.2019 05:30
Two technicians are discussing a resistance measurement. technician a states that components being measured should be removed or isolated from the circuit. technician b states that power to the circuit should be disconnected when measuring resistance. which technician is correct?
Answers: 1
question
Computers and Technology, 25.06.2019 10:00
Most common level of education for a programmer or software developer
Answers: 1
You know the right answer?
Consider the following method intended to modify the parameter names by removing all instances of th...
Questions
Questions on the website: 13722363