Java Continue Keyword

Java Continue Keyword


Continue Keyword In Java

● Continue statement is used to skip the body of loop, or in other words -

● Continue stops the execution of the current iteration and goes back to the beginning of the loop to begin the next iteration.

Example - 

package javaLearnings;
import java.util.Scanner;

public class Main {
  public static void main(String args[]){

      int i;
      for(i=1;i<=15;i++){
          if(i%3==0)
              continue;
          System.out.println(i);
      }

          }
      }


---------------------------
Output -
1
2
4
5
7
8
10
11
13
14