Suppose an ArrayList list contains {"red", "red", "green"}. What is the list after the following code?

```
String element = "red";
for (int i = list.size() - 1; i >= 0; i--)
if (list.get(i).equals(element))
list.remove(element);
```
a. {"red", "red", "green"}
b. {"red", "green"}
c. {"green"}
d. {}


c. {"green"}

Computer Science & Information Technology

You might also like to view...

What type of device is shown on the left in the accompanying figure?

A. input B. output C. storage D. system

Computer Science & Information Technology

Programs that can handle all kinds of user errors are called elegant.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

In planning a Web site what is one of the most important questions that a Web designer must answer?

A) What is purpose of Web site? B) What language will the Web programmer use? C) What is the Web site's size? D) What is the development budget?

Computer Science & Information Technology

When considering an algorithm’s efficiency when working with external data, what is the dominant factor?

a. the brand of the computer b. the programming language c. the skill of the programmer d. the time required for block access

Computer Science & Information Technology