Question: 16 - Assume that aList is a valid ArrayList containing the following: 3, 5, 9, 7, 4, 2, 41 Which of the following places -100

16 - Assume that aList is a valid ArrayList containing the following:

3, 5, 9, 7, 4, 2, 41

Which of the following places -100 immediately before 2 in aList?

Question 16 options:

1)

aList.add(-100);

2)

aList.add(-100, 5);

3)

aList.add(4, -100);

4)

aList.add(-100, 4);

5)

aList.add(5, -100);

17 - Assume that aList is a valid ArrayList containing the following:

5.3, 15.1, 8.2, 6.3, 24.1, 2.0, 4.1

Which of the following places -100 immediately after 6.3 in aList?

Question 17 options:

1)

aList.add(-100);

2)

aList.add(4, -100);

3)

aList.add(-100, 4);

4)

aList.add(3, -100);

5)

aList.add(-100, 3);

18 - Assume that aList is a valid ArrayList containing the following:

Wei, Marila, Anna, Neal, Rachel, Jack, Aneesh

Which of the following removes Anna from aList? (3 points)

I. aList.remove(2, "Anna"); II. aList.remove("Anna"); III. aList.remove("Anna", 2);

Question 18 options:

1)

Statement I only.

2)

Statement II only.

3)

Statement III only.

4)

Statements I and II only.

5)

Statements II and III only.

19 - Assume that aList is a valid ArrayList containing the following:

Wei, Marila, Anna, Neal, Rachel, Jack, Aneesh

When the following statement executes, what does aList contain?

aList.set(1, "Beth");

Question 19 options:

1)

Wei, Marila, Anna, Neal, Rachel, Jack, Aneesh

2)

Wei, Beth, Anna, Neal, Rachel, Jack, Aneesh

3)

Wei, Beth, Marila, Anna, Rachel, Jack, Aneesh

4)

Beth, Marila, Anna, Neal, Rachel, Jack, Aneesh

5)

Beth, Wei, Marila, Anna, Neal, Rachel, Jack, Aneesh

20 - Which of the following would be best handled with an array?

Question 20 options:

1)

A list of all the states in the United States.

2)

A list of cars that get 30 miles per gallon or better.

3)

A list of students who complete AP Computer Science.

4)

The names of animals on the endangered species list.

5)

The titles of books at the library.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!