Jump to content
Wikibooks The Free Textbook Project

Java Programming/Keywords/while

From Wikibooks, open books for an open world

This is the current revision of this page, as edited by Minorax (discuss | contribs) at 13:56, 25 March 2020 (Reverted edits by 2605:A000:1701:E366:A99A:9E25:E2D7:8C1A (talk) to last version by 103.212.212.106). The present address (URL) is a permanent link to this version.

Revision as of 13:56, 25 March 2020 by Minorax (discuss | contribs) (Reverted edits by 2605:A000:1701:E366:A99A:9E25:E2D7:8C1A (talk) to last version by 103.212.212.106)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

while is a Java keyword.

It starts a looping block.

The general syntax of a while , using Extended Backus-Naur Form, is

while-looping-statement ::= while  condition-clause 
 single-statement | block-statement
 
condition-clause  ::= ( Boolean Expression )
single-statement  ::= Statement
block-statement  ::= { Statement [ Statements ] }

For example:

Computer code
while(i<maxLoopIter)
{
System.out.println("Iter="+i++);
}

See also:

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