I am creating a method that given a matrix, put the whole frame full of zeros, that is to say for the matrix
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
the exit should be
0 0 0 0
0 6 7 0
0 10 11 0
0 0 0 0
I have this code:
public static void llenaCeros(int[][] matriz) {
for (int i = 0; i <1; i++) { //fila 0
for (int j = 0; j <= ladoh; j++) {
matriz[i][j]=0;
System.out.println(matriz[i][j]);
}
System.out.println();
}
}
and it prints a matrix of a column filled with zeros, but not the rest of the matrix.