subject

Consider the following method that is intended to modify its parameter nameList by replacing all occurrences of name with newValue. public void replace (ArrayList nameList, String name,
String newValue)
{
for (int j = 0; j < nameList. size(); j++)
{
if (/*expression */)
{
nameList. set(j, newValue);
}
}
}

Which of the following can be used to replace /* expression */ os that replace will work as intended?

a. nameList[j].equals(name)
b. nameList. get(j).equals(name)
c. nameList. get(j) == name
d. nameList[j] == name
e. nameList. remove(j)

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 01:10, kristofwr3444
Are special combinations of keys that tell a computer to perform a command. keypads multi-keys combinations shortcuts
Answers: 1
image
Computers and Technology, 23.06.2019 02:00, rah45
Which of the following is not a source of sustainable raw materials? a) coal mine b) flick of sheep c) cotton plantation d) line forest.
Answers: 2
image
Computers and Technology, 23.06.2019 23:30, issacurlyheadka
A. in packet tracer, only the server-pt device can act as a server. desktop or laptop pcs cannot act as a server. based on your studies so far, explain the client-server model.
Answers: 2
image
Computers and Technology, 24.06.2019 00:00, miguelturner
Which tool could be used to display only rows containing presidents who served two terms
Answers: 3
You know the right answer?
Consider the following method that is intended to modify its parameter nameList by replacing all occ...

Questions in other subjects:

Konu
Business, 02.07.2019 22:00