find the greatest and lowest number in 2D array

Hi,

I'm trying to make a code that calculates and shows the greatest and lowest integer in a 2D array. Here' s what I have so far. I don't know how to continue.

Thanks in advance,

le_albina

public class GreatestLowestRange{

public static void main(String [] args){

int greatest, lowest, range;

int [] [] table = {{10, 12, 14, 16, 18},

{20, 22, 24, 26, 28},

{30, 32, 34, 36, 38},

{40, 42, 44, 46, 48}};

greatest= Greatest(table);

}//End main

//************************************************** *******

private static int Greatest(int tarray[][]){

int i, j, greatest;

greatest=tarray[0][0];

//loop for rows

for (i=0; i<tarray; i++)

{

//loop for columns

for (j=0; j<tarray[i]; j++)

{

if(tarray[i][j]>greatest)

greatest=tarray[i][j];

}//end 1rst for

}//en 2nd for

}//end Greatest

}//end GreatestLowestRange