Java Continue statement is used to skip the current iteration of the loop means you can use it to jump the next iteration of the loop. continue statement and break statement is used in Java to control the iteration of the loop but both are optional.
Syntax:

//statement;
continue;

Java Continue statement Example

if you want to skip the iteration of the loop or jump the next iteration then you can use continue statement. Let’s see the example ofcontinue how it works-

public class DemoContinue { 
public static void main(String[] args) { 
for(int n=1;n<=5;n++){ 
if(n==2){ 
continue; 
} 
System.out.println(n); 
} 
} 
}

It will generate the following results-
Output:

1
3
4
5

In the above example, continue statement is executed and it skipped 2 because we set the condition if n==2 then continue