So I have a code that will print a table of 2 dimensional arrays. The problem that I've run into is that I have absolutely no idea how to multiply and find the product of the arrays. Any help is appreciated. Thanks
public class MultiplyingArrays {
public static void main(String[] args) {
int firstarray[][] = {{1, 2, -2, 0}, {-3, 4, 7, 2}, {6, 0, 3, 1}};
int secondarray[][] = {{-1, 3}, {0, 9}, {1, -11}, {4, -5}};
System.out.println("This is the first array");
display(firstarray);
System.out.println("This is the second array");
display(secondarray);
}
public static void display(int x[][]) {
for (int row = 0; row < x.length; row++) {
for (int column = 0; column < x[row].length; column++) {
System.out.print(x[row][column] + "\t");
}
System.out.println();
}
}
}
The desired result would be:
-3 43
18 60
1 -20