You are here: Home / Topics / Continue statement example in Java

Continue statement example in Java

Filed under: Java on 2023-08-18 06:44:47

// continue staement example

public class ContinueStatement{

   public static void main(String[] args) {
       for (int i = 0; i < 10; i++) {            
           if (i % 2 == 0) {
               continue;
 // if condition satisfied then here loop skip below part
           }
    System.out.println(i);
       }

   }

}


Output:

1 3 5 7 9

About Author:
Y
Yatendra Sir     View Profile
Hi, I am using MCQ Buddy. I love to share content on this website.