AP Computer Science A Question of the Day

Test your knowledge with a hand-picked multiple-choice question.

public static void foo() {

int x = 10; y = 21, z = 30;

int[] arr = null;

for(int i = 0; i < y; i+= 4) {

arr = new int<u>i / 5</u>;

}

for(int i = 0; i < x; i++) {

arr<u>i</u> = z / i;

}

for(int i = 0; i < z; i++) {

arr<u>i</u> = z * i;

}

}

Which of the following lines of code will cause a compile-time error?

Select an answer and click Check.