Java OCA OCP Practice Question 1083

Question

Which type of loop has a boolean condition that is first checked after a single iteration through the loop?

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


A.

Note

A do-while loop has a condition that returns a boolean at the end of the loop.

Therefore, Option A is correct.

Option D is incorrect because a while loop has this condition at the beginning of the loop.

A traditional for loop is best known for having a loop variable, making Option B incorrect.

Option C is incorrect because there is no condition as part of the loop construct.




PreviousNext

Related