Jump to content
Wikibooks The Free Textbook Project

Java Programming/Keywords/do

From Wikibooks, open books for an open world

This is the current revision of this page, as edited by DannyS712 (discuss | contribs) at 06:02, 16 April 2020 (Update syntaxhighlight tags - remove use of deprecated <source> tags). The present address (URL) is a permanent link to this version.

Revision as of 06:02, 16 April 2020 by DannyS712 (discuss | contribs) (Update syntaxhighlight tags - remove use of deprecated <source> tags)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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:

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

For example:

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

See also:

AltStyle によって変換されたページ (->オリジナル) /