Continue Statement In Java

The continue statement is used to jump to the next iteration of the loop immediately.

class Continue1 
{  
public static void main(String[] args)
{  
for(int i=1;i<=10;i++)
{  
if(i==5)
{
continue;  
}  
System.out.println(i);  
}  
}  
} 
Output:
1
2
3
4
6
7
8
9
10

Leave a Reply