public class MultiDimensional
{
public static void main (String []
args)
{
Table table
= new Table ();
table.fillTable
();
table.displayTable
();
} // method main
} // class Multidimensional
class Table
{
private int [] [] matrix;
final int maxRow = 5;
final int maxCol = 5;
Table ()
{
matrix = new
int [maxRow][maxCol];
} // constructor
public void fillTable ()
{
for (int row
= 0; row < maxRow; row++)
for (int col = 0; col < maxCol; col++)
matrix [row][col] = row + col;
} // method fillTable
public void displayTable ()
{
for (int row
= 0; row < maxRow; row ++)
{
for (int col = 0; col < maxCol; col ++)
System.out.print (" " + matrix [row][col]);
System.out.println ();
}
} // method displayTable
} // class Table