Java program to execute continue using inner loop method

A Java program to execute continue using inner loop method. In this program we can execute the inner loop with continue statement. A Java programme that uses the inner loop method to keep running. We may use the continue command to execute the inner loop in this program. In any loop control structure, the continue keyword can be utilised. It forces the loop to jump to the next iteration of the loop right away. Control is instantly given to the update statement when the continue keyword is used in a for loop.

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

3 5
4 1
4 2
4 3
4 4
4 5
5 1
5 2
5 3
5 4
5 5