Help with array of int[][]

From: Miss Michelle. Heigardt (michelleheigardt_at_hotmail.com)
Date: 03/27/05


Date: 27 Mar 2005 06:49:04 -0800

Hallo

If I have a int matrix like this

int m=new int[5][8];

and I have a method

protected void methodName(int[][] matrix,int noRows)
{
  System.out.println("No rows="+String.valueOf(noRows));
  int noCols=matrix.length/noRows;
  System.out.println("No cols="+String.valueOf(noCols));
}

and I call it like

methodName(m,5);

Why is the noCols printed wrong?

Thank you
Michelle