Java OCA OCP Practice Question 1359

Question

Which type of loop is best known for using an index or counter?

  • A. do-while loop
  • B. for (traditional)
  • C. for-each
  • D. while


B.

Note

A traditional for loop is best known for having a loop variable counting up or down as the loop progresses.

Therefore, Option B is correct.

Options A and D are incorrect because do-while and while loops are known for their boolean conditions.

Option C is incorrect because the for-each loop iterates through without an index.




PreviousNext

Related