I have to write a method that prints values in a matrix using recursion. When I try to compile the tester I get an error message:"cannot find symbol - method printMat(int[][])".
my Code:
public static void printMat(int ma[][]){
printMat(ma,0,0);
}
public static void printMat(int m[][], int i, int j){
System.out.print("[" + m[i][j] + "]");
if (i == m.length && j == m.length)
{
return;
}
if (j == m.length)
{
j = 0;
++i;
printMat(m, i, j);
}
else
{
j++;
printMat(m, i, j);
}
}
what am doing wrong?