Java Programming/Keywords/do

From Wikibooks, the open-content textbooks collection

< Java Programming | Keywords
Jump to: navigation, search

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 statement executes

Syntax:

do{
   statement;
 } while (condition);


For Example:

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

See also:

Personal tools
Create a book
  • Add wiki page
  • Collections help