public class ContinueExample {
public static void main(String[] args){
for (int j=0; j<=6; j++)
{
if (j==4)
{
continue;
}
System.out.print(j+" ");
}
}
}
0 1 2 3 5 6
public class ContinueExample2 {
public static void main(String[] args){
int counter=10;
while (counter >=0)
{
if (counter==7)
{
counter--;
continue;
}
System.out.print(counter+" ");
counter--;
}
}
}
10 9 8 6 5 4 3 2 1 0
public class ContinueExample3 {
public static void main(String[] args){
int j=0;
do
{
if (j==7)
{
j++;
continue;
}
System.out.print(j+ " ");
j++;
}while(j<10);
}
}