// Making multidimensional arrays
int firstArray[][] = {{8, 9, 10, 11, 12}, {13, 14, 15, 16, 17}};
int secondArray[][] = {{30, 31, 32, 33}, {43}, {4, 5, 6}};
// Printing out the first array by calling it from the **TABLE** method
System.out.println("This is the first array");
table(firstArray);
// Printing out the second array by calling it from the **TABLE** method
System.out.println("This is the second array");
table(secondArray);
}
// Making a new method and passing a multidimensional array in the parameters
public static void table(int x[][]) {
// First for loop: loops through the rows which is the firstArray[]
for (int row = 0; row < x.length; row++) {
// Second for loop: loops through the columns which is the secondArray[]
for (int column = 0; column < x[row].length; column++) {
// Printing the rows and the columns with spaces in between the values
System.out.print(x[row][column] + "\t");
}
// Printing a new line whenever the values of the first part of the array end so it is displayed in a table formation
System.out.println();