?

AP® Computer Science A

Free Version

Upgrade subject to access all content

Easy

ArrayList Integer Adds

APCSA-P6E1VF

Which of the following could be used to populate the nums array list?

ArrayList<Integer> nums = new ArrayList<Integer>();

I.
nums.add(10);
nums.add(20);

II.
nums.add(new Integer(10));
nums.add(new Integer(20));

III.
nums.add("10";);
nums.add("20";);
A

I only.

B

II only.

C

III only.

D

I and II only.

E

I, II, and III.