The Java® Language Specification, Java SE 7 Edition, Fourth Edition
by James Gosling, Bill Joy, Guy Steele, Gilad Bracha, Alex Buckley
14.13. The do Statement
The do statement executes a Statement and an Expression repeatedly until the value of the Expression is false.
DoStatement: do Statement while ( Expression ) ;
The Expression must have type boolean or Boolean, or a compile-time error occurs.
A do statement is executed by first executing the Statement. Then there is a choice:
• If execution of the Statement completes normally, then the Expression is evaluated. If the result is of type Boolean, it is subject to unboxing conversion (§5.1.8).
If evaluation of the Expression or the subsequent unboxing conversion (if any) completes abruptly for some reason, the do statement completes abruptly for the same reason.
Otherwise, there is a choice based on the resulting value: ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access