Java OCA OCP Practice Question 872

Question

Which type of loop is guaranteed to have the body execute at least once?

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


A.

Note

A do-while loop checks the loop condition after execution of the loop body.

This ensures it always executes at least once, and Option A is correct.




PreviousNext

Related