?

AP® Computer Science A

Free Version

Upgrade subject to access all content

Moderate

Declaring the Type of Elements in an ArrayList

APCSA-PK6GEL

Which of the following statements is invalid (will not compile) when declaring an ArrayList variable?

A
ArrayList<String> list;
B
ArrayList<Double> list;
C
ArrayList<Boolean> list;
D
ArrayList<Object> list;
E
ArrayList<int> list;