Java continue Statement
Overview
In this tutorial, we will learn Java continue statement. When a continue statement is executed the loop iteration is skipped.
continue statement
continue is used to skip iterations in a loop if a specific condition is satisfied. For example, in the below program we will skip the for loop when i is even number.
public class ContinueDemo { public static void main(String[] args) { // TODO Auto-generated method stub for (int i = 1; i < 10; i++) { if (i % 2 ==0) { continue; // This will skip when i is even } System.out.println("i=" +i); } } }
—
Java Tutorials
Java Tutorial on this website:
https://www.testingdocs.com/java-tutorial/
For more information on Java, visit the official website :