Answer:
Following are the java code to this question:
for (int x= 0;x<x1.length;x++)//defining for loop for print column value
{
for (int y= 0;y<x1[x].length;y++)//defining for loop for print row value
{
System.out.print(x1[x][y]=y+1);//print array value
}
System.out.println();// use print method for line spacing
}
Explanation:
The full code is defined in the attached file please find it.
In the above-given code, the nested for loop is used, that's function can be defined as follows:
In the outer loop, an x variable is used, that starts from 0 and ends when its value is equal to its array length.
In the inner loop, a y variable is used that also starts from 0 and ends when its value is equal to the length of x, and inside the loop, the print method is used that uses an array to assign value and print in the given order.