Java Design Pattern
Introduction to Java 10
Introduction to Java 11
Introduction to Java 12

Java Continue statement

Like a break statement, it is another transfer statement.
The general form is : continue;
When a continue statement executes based on a condition inside a loop, then some portion
of the loop is skipped.

Let’s see an example;

ContinueExample.java

class ContinueExample {
	public static void main(String[] args) {
		for (int k = 1; k <= 5; k++) {
			System.out.println("Hello");
			if (k == 3) {
				continue;
			}
			System.out.println("SILAN SOFTWARE");
		}
	}
}

Output

Hello
SILAN SOFTWARE
Hello
SILAN SOFTWARE
Hello
SILAN SOFTWARE
Hello
SILAN SOFTWARE
Hello
SILAN SOFTWARE

About the Author



Silan Software is one of the India's leading provider of offline & online training for Java, Python, AI (Machine Learning, Deep Learning), Data Science, Software Development & many more emerging Technologies.


We provide Academic Training || Industrial Training || Corporate Training || Internship || Java || Python || AI using Python || Data Science etc






 PreviousNext