Java do-while

Sometimes it is necessary that the block or statement must be executed at least once but if the condition is initially at a false state then the block will not be executed. So for the situation where a block of code must be executed at least once do-while loop comes in play.
do-while is an exit-control loop that is it checks the condition after the first execution of the block. And it keeps executing the block until the condition state is false.

Syntax of do..while loop:

Example of do-while statement: