Question: Question 10 What does the following code do? Assume names is an array of String values. for (int index = names.length-1; index >= 0; index--)

Question 10

What does the following code do? Assume "names" is an array of String values.

for (int index = names.length-1; index >= 0; index--)

System.out.println(names[index]);

A.

It will generate an error because index cannot be zero.

B.

It prints the values stored in names backwards, except for the last value in the array.

C.

It prints the values stored in names backwards.

D.

It does not print out anything because the index should be increased not decreased.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!