Help. Create 2D array method that returns index of row that contains the most zeros.

I need help creating a 2D array method that returns the index of row that contains the most zeros. I have created a method to count the zeros in each row first. I inserted this method into the other method. I have tried many different things and nothing seems to work. Currently I tried to have the max number of zeros outputted. This doesn't work either. I would like to have the index displayed.

Code:

`public class P118 `

{

public static void main(String[]args)

{

int[][]num = {{0,3,9}, {1,3,0}, {0,9,9}, {0,0,7}};

System.out.print(rowWithMostZeros(num));

}

public static int rowWithMostZeros(int[][]arr)

{

int count=0, count2=0, rowNum = -1, max=0;

for(int row = 0; row<arr.length-1;row++)

{

count = countZeros(arr[row]);

for(int i = 1;i<arr.length; i++)

{

count2 = countZeros(arr[i]);

if(count>count2)

{

max=count;

}

}

}

return max;

}

public static int countZeros(int[]x)

{

int count = 0;

for(int i = 0; i<x.length;i++)

{

if(x[i]==0)

{

count++;

}

}

return count;

}

}