Quiz: ArrayList

1

We have a list with 3 elements, i.e. [5, 3, 1], and the following code is executed.

nums.add(6);

nums.add(0, 4);

nums.remove(1);

What will be the resulting List?

A)

[5,3,1,6]

B)

[4,3,1,6]

C)

[4,3,6]

D)

[4,5,3,6]

Question 1 of 80 attempted

Get hands-on with 1200+ tech skills courses.