Java OCA OCP Practice Question 1071

Question

Which of the following statements is/are true?

A traditional for loop can iterate through an array starting

  • I. from index 0.
  • II. from the end.
  • A. Only I
  • B. Only II
  • C. Both statements
  • D. Neither statement


C.

Note

With a traditional for loop, you control the order in which indexes are visited in code.

You can loop through an array in ascending or descending order.

Option C is correct.




PreviousNext

Related