|
|
Example 1:
class Continue_1 {
public static void main( String args[] ) {
int n = 0;
while ( n < 5 ) {
System.out.println("outer while here n == " + n);
while ( n < 5 ) { // while ( true ) --> which problem
n++;
System.out.println(" inner while here n == " + n);
if ( n > 2 )
continue;
System.out.println(" inner while here n == " + n + "--------");
}
}
}
}
Source Code: Src/4/Continue_1.java
Example 2:
class Continue_2 {
public static void main( String args[] ) {
int n = 0;
here:
while ( n < 5 ) {
System.out.println("outer while here n == " + n);
while ( n < 5 ) { // while ( true ) --> which problem
n++;
System.out.println(" inner while here n == " + n);
if ( n > 2 )
continue here;
System.out.println(" inner while here n == " + n + "--------");
}
}
}
}
Source Code: Src/4/Continue_2.java
|
|
Created by
unroff,
java2html &
& hp-tools.
© by csfac. All Rights Reserved (2010).
It is not allowed to print these pages on a CAST printer.
Last modified: 01/April/10 (17:16)