N.3. Labeled continue Statement

The continue statement presented in Section 5.7 proceeds with the next iteration (repetition) of the immediately enclosing while, for or do...while. The labeled continue statement skips the remaining statements in that statement’s body and any number of enclosing repetition statements and proceeds with the next iteration of the enclosing labeled repetition statement (i.e., a for, while or do...while preceded by a label). In labeled while and do...while statements, the program evaluates the loop-continuation test of the labeled loop immediately after the continue statement executes. In a labeled for, the increment expression is executed and the loop-continuation test is evaluated. Figure N.2 uses a labeled continue ...

Get Java™ How to Program, Seventh Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.