next next up down toc Memos schedule allInOne PDF PDF mail
all, section 4.24.

4.24.  Continue

Example 1:

Src/4/Continue_1.java.minusSTART_STOP


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:

Src/4/Continue_2.java.minusSTART_STOP



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


back next up down toc Memos schedule allInOne pdf PDF mail

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)