< Java Programming < Keywords

do is a Java keyword.

It starts a do-while looping block. The do-while loop is functionally similar to the while loop, except the condition is evaluated after the statements execute

Syntax:

do {
    //statements;
} while (condition);

For example:

do {
    i++;
} while ( i < maxLoopIter );

See also:

This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.