help sum of two array2d
public class MultArray { static public void sum(int[][] a, int[][] b){ int rows = a[0].length/2; int colums = a[1].length; int[][] soma = new int[rows ][colums ]; for(int i = 0; i < rows; i++){ for(int j = 0; i < colums ; j++){ soma[i][j]= a[i][j] + b[i][j]; } } System.out.println("sum of matrizes is : "); for(int[] index: soma){ for(int elementos: index){ System.out.print(elementos+ " "); } System.out.println(""); } } public static void main(String args[]) { int[][] first = { { 2, 3, 4,-6 }, { 5, 2, 3,0} }; int[][] second = { { -4, 5, 3,7 }, { 5, 6, 3,1 } }; sum(first , second ); } }