do Statement

Top  Previous  Next

Terminates the current iteration in the loop, if a specified condition occurs, and continues with the next iteration in the loop.


do statement

while (expression)


statementThe statement to be executed if expression is true.
expressionAn expression that could be evaluated to Boolean true or false.


Evaluates expression and if it is true, executes statement; otherwise terminates the loop.


Compared to the while statement, a do statement is executed one time before the expression is evaluated.