AP Computer Science A Question of the Day

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

Consider the following code:

int<u></u> vals = {6,1,41,5,1};

int<u></u><u></u> newVals = new int<u>vals.length</u><u></u>;

for(int i = 0; i < vals.length; i++) {

newVals<u>i</u> = new int<u>vals\[i\];

for(int j = 0; j < vals<u>i</u>;j++) {

newVals<u>i</u><u>j</u> = vals<u>i</u> * (j+1);

}

}

What does the code above do?

Select an answer and click Check.