Limited access

Upgrade to access all content for this subject

Consider the following code.

ArrayList<Integer> ratings = new ArrayList<Integer>();
ratings.add(29);
ratings.add(0,12);
ratings.add(1,4);
ratings.add(0,36);
ratings.add(2,123);
ratings.add(1,54);
System.out.println(ratings);

What is printed to the console when the following code is executed?

A
[36, 54, 12, 123, 4, 29]
B
[36, 12, 54, 123, 4, 29]
C
[36, 54, 12, 29, 4, 123]
D
[12, 36, 4, 54, 29, 123]
E
[29, 12, 4, 36, 123, 54]
Select an assignment template