Java Continue Keyword Example


Continue statement breaks only one iteration in the loop, if a specified condition occurs, and continues with the next iteration in the loop.

Program
public class ContinueExample { public static void main(String[] args) { //using for loop for(int i=0;i<=5;i++){ if(i==3){ //breaking the loop continue; } System.out.println(i); } } }
Input
Output