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

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]): It does not print out anything because the index should be increased not decreased. It will generate an error because index cannot be zero. It prints the values stored in names backwards, except for the last value in the array. lt prints the values stored in names backwards
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
