?

AP® Computer Science A

Free Version

Upgrade subject to access all content

Easy

ArrayList Advantages Compared to an Array

APCSA-ETXR4W

Which of the following is an advantage of using an array list versus using an array?

A

An array list can have objects as its elements, but an array cannot have objects as its elements

B

You cannot modify elements in arrays, but you can modify array list elements

C

An array list adjusts its size automatically, whereas an array has a static size

D

It is not possible to encounter a NullPointerException when accessing an array list, but it is when accessing an array

E

An enhanced for loop can be used with an array list, but not with an array