I've been trying to solve this for the past couple of hours with no luck, Here I'm supposed to pass in a multidimensional Array from the main method, to another method that's:
public static int[] CalcAllRowSums(int[][] a)
{
int[] p = {a.length};
int x = 0;
int sum = 0;
for ( int r = 0; r < a.length; r++ ) {
for ( int c = 0; c <= a[x].length-1; c++ ) {
sum += a[x][r];
}
p[x] = sum;
}
return p;
}
This is how I did it, but when I print out the method from the main method I get the address instead of the actual array.
Thank