Sum of 2 different 2d arrays
问题 I need help writing a method to find out a sum of 2 different sized 2d arrays. public static int[][] summary(int[][] tab1, int[][] tab2, int x) { int[][] finalTab = new int[4][5]; // I took sizes of bigger one if (x < 0) { for (int i = 0; i < finalTab.length - 1; i++) { for (int j = 0; j < finalTab[i].length - 1; j++) { finalTab[i][j] = tab1[i][j] + tab2[i][j]; if (tab1[i][j] == 0) { finalTab[i][j] = tab2[i][j]; } } } for (int i = 0; i < finalTab.length; i++) { for (int j = 0; j < finalTab[i]