Limited access

Upgrade to access all content for this subject

Which of the following will result in a NullPointerException?

I.

int[] testScores = null;
for (int i=0; i>0 && i<testScores.length; i++)
    testScores[i] = i*2;

II.

int[] testScores = {0};
for (int i=0; i<testScores.length; i++)
    testScores[i] = i*2;

III.

int[] scores = null;
int[] testScores = scores;
for (int i=0; i<testScores.length; i++)
    testScores[i] = i*2;
A

I only.

B

II only.

C

III only.

D

I and II only.

E

I and III only.

Select an assignment template