BLOCKS AND STATEMENTS
The
continue
 Statement
14.14
14.14   The
continue
 Statement
A
continue
 statement may occur only in a
while
,
do
, or
for
 statement; state 
ments of these three kinds are called
iteration statements
. Control passes to the
loop continuation point of an iteration statement.
ContinueStatement:
continue
Identifier
opt
 ;
A
continue
 statement with no label attempts to transfer control to the inner 
most enclosing
while
,
do
, or
for
 statement; this statement, which is called the
continue target
, then immediately ends the current iteration and begins a new one.
To be precise, such a
continue
 statement always completes abruptly, the reason
being a
continue
 with no label. If no
while
,
do
, or
for
 statement encloses the
continue
 statement, a compile time error occurs.
A
continue
 statement with label
Identifier
 attempts to transfer control to the
enclosing labeled statement ( 14.6) that has the same
Identifier
 as its label; that
statement, which is called the
continue target
, then immediately ends the current
iteration and begins a new one. The continue target must be a
while
,
do
, or
for
statement or a compile time error occurs. More precisely, a
continue
 statement
with label
Identifier
 always completes abruptly, the reason being a
continue
 with
label
Identifier
. If no labeled statement with
Identifier
 as its label contains the
continue
 statement, a compile time error occurs.
It can be seen, then, that a
continue
 statement always completes abruptly.
See the descriptions of the
while
 statement ( 14.10),
do
 statement ( 14.11),
and
for
 statement ( 14.12) for a discussion of the handling of abrupt termination
because of
continue
.
The preceding descriptions say  attempts to transfer control  rather than just
 transfers control  because if there are any
try
 statements ( 14.18) within the
continue target whose
try
 blocks contain the
continue
 statement, then any
finally
 clauses of those
try
 statements are executed, in order, innermost to out 
ermost, before control is transferred to the continue target. Abrupt completion of a
finally
 clause can disrupt the transfer of control initiated by a
continue
 state 
ment.
In the
Graph
 example in the preceding section, one of the
break
 statements is
used to finish execution of the entire body of the outermost
for
 loop. This
break
can be replaced by a
continue
 if the
for
 loop itself is labeled:
285






footer




 

 

 

 

 Home | About Us | Network | Services | Support | FAQ | Control Panel | Order Online | Sitemap | Contact

java hosting

 

Our partners: PHP: Hypertext Preprocessor Best Web Hosting Java Web Hosting Inexpensive Web Hosting  Jsp Web Hosting

Cheapest Web Hosting Jsp Hosting Cheap Hosting

Visionwebhosting.net Business web hosting division of Web Design Plus. All rights reserved