java tutorial - Operator continue - java programming - learn java - java basics - java for beginners



Java operator continue

Learn Java - Java tutorial - Java operator continue - Java examples - Java programs

Operator continue — the continue operator is a keyword that can be used in any structure of a loop, and it calls the loop to go to the next iteration immediately.

  • In the for loop, the continue keyword disposes of the process so that you immediately go to the update operator.
  • In the while or do ... while loops, the control immediately goes into a logical expression.

Syntax

The syntax of one continue statement inside any Java cycle:

continue;
click below button to copy the code. By - java tutorial - team

Process description

 operator continue

Learn java - java tutorial - java-continue - java examples - java programs

Sample Code

public class Test {

   public static void main(String args[]) {
      int [] numbers = {10, 20, 30, 40, 50};

      for(int y : numbers ) {
         if( y == 30 ) {
      continue;
         }
         System.out.print( y );
         System.out.print("\n");
      }
   }
}
click below button to copy the code. By - java tutorial - team

Output

10
20
40
50

Related Searches to Operator continue