TheDocumentation Index
Fetch the complete documentation index at: https://docs.syntblaze.com/llms.txt
Use this file to discover all available pages before exploring further.
continue statement is an unconditional branching control flow construct that immediately terminates the execution of the current iteration within an enclosing loop. Upon execution, control is transferred directly to the loop’s next iteration phase, bypassing any remaining statements in the current loop body.
The exact transfer of control depends on the type of the enclosing loop:
- Traditional
forloop: Control jumps to the loop’s update expression, followed by the evaluation of the boolean termination condition. - Enhanced
forloop (for-each): Control transfers to the underlying iterator to check for and fetch the next element; there is no explicit update expression. whileanddo-whileloops: Control jumps directly to the evaluation of the boolean termination condition.
continue statement: unlabeled and labeled.
Unlabeled continue
The unlabeled form affects only the innermost enclosing loop. It halts the current iteration of that specific loop and proceeds to its next iteration.
Syntax:
Labeled continue
The labeled form is used in conjunction with nested loops. It allows the developer to skip the current iteration of a specific outer loop, rather than the innermost loop. The label must immediately precede the target loop declaration.
Syntax:
Technical Constraints
- A
continuestatement must be strictly contained within the body of afor(traditional or enhanced),while, ordo-whileloop. Using it outside of a loop construct results in a compilation error. - A labeled
continuemust reference a valid label that is attached to an enclosing loop construct. Referencing a label attached to a non-loop block (like anifstatement or a generic code block) will result in a compilation error.
Master Java with Deep Grasping Methodology!Learn More





