?

AP® Computer Science A

Free Version

Upgrade subject to access all content

Moderate

Evaluating Array a and b

APCSA-8MVIL6

Consider the following code segment.

int[] a = {70, 50, 60, 90, 10};
int[] b = {3, 0, 4, 1, 2};

for (int i=0; i<a.length; i++)
{
    if (a[i] > a[b[i]])
        System.out.print(a[i]);
    else
        System.out.print(b[b[i]]);
    System.out.print(" ");
}

What is printed as a result of executing the code segment?

A

3 0 60 90 2

B

1 3 2 0 4

C

0 1 60 90 4

D

1 3 60 90 4

E

70 50 60 90 10