?

AP® Computer Science A

Free Version

Upgrade subject to access all content

Easy

Interpreting a Loop That Goes Through an Array of Strings

APCSA-TIE64Y

Consider the following code.

String[] people = {"Hank", "George", "Carol", "Johnsie"};
int d = 0;

for (int i=1; i<people.length; i++)
{
    d+=people.length;
}
System.out.println(d);

What is printed as a result of executing this code?

A

12

B

16

C

18

D

22

E

A syntax error is encountered.