?

AP® Computer Science A

Free Version

Upgrade subject to access all content

Easy

Least Expensive Code

APCSA-YEE7FW

A programmer needs to create an array of the ages (in whole years) of all the students at the local high school in a small town, but he does not know how many students are at the high school.

Of the following, which would be the least expensive, valid option for declaring this array?

A
int[] ages = new int[10];
B
int[] ages = new int[5000];
C
int[] ages = new int[1000000];
D
String[] ages = new String[5000];
E
String[] ages = new String[1000000];