Jump to content
Wikibooks The Free Textbook Project

Java Programming/Keywords/continue

From Wikibooks, open books for an open world

This is the current revision of this page, as edited by Strange quark (discuss | contribs) at 18:23, 4 July 2017 (Fix categorization). The present address (URL) is a permanent link to this version.

Revision as of 18:23, 4 July 2017 by Strange quark (discuss | contribs) (Fix categorization)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

continue is a Java keyword. It skips the remainder of the loop and continues with the next iteration.

For example:

Computer code
intmaxLoopIter=7;
for(inti=0;i<maxLoopIter;i++){
if(i==5){
continue;// -- 5 iteration is skipped --
}
System.println("Iteration = "+i);
}


results in

0
1
2
3
4
6
7

See also

[edit | edit source ]

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