?

AP® Computer Science A

Free Version

Upgrade subject to access all content

Easy

ArrayList Adding Integer Elements to numsList

APCSA-VV1TRG

Consider the following code segment.

ArrayList numsList;
numsList = new ArrayList();
numsList.add(0,50);
numsList.add(70);
numsList.add(0,100);
numsList.add(200);
numsList.add(0,20);
numsList.add(10);
System.out.println(numsList);

What is printed as a result of executing the code segment?

A

[20, 100, 50, 70, 200, 10]

B

[10, 20, 50, 70, 100, 200]

C

[50, 70, 100, 200, 20, 10]

D

[200, 100, 70, 50, 20, 10]

E

[70, 200, 10, 20, 100, 50]