WEB DEVELOPER SITE
PHP7
 

Continue statement in java


Causes the loop to skip the remainder of its body and immediately retest its condition prior to reiterating.


Syntax

The syntax of a continue is a single statement inside any loop −

continue;

Example

public class Test {

   public static void main(String args[]) {
      int [] numbers = {20, 40, 60, 70, 590};

      for(int x : numbers ) {
         if( x == 25 ) {
            continue;
         }
         System.out.print( x );
         System.out.print("\n");
      }
   }
}
Run Example »