Hi, I have a 2D array of doubles in Java which is basically a table of values and I want to find out how many rows it has...
It is declared elsewhere (and allocated) like this:
double[][] table;
then passed to a function...
private void doSomething(double[][] table)
{
}
In my function I want to know the length of each dimension without having to pass them around as arguments. I can do this for the number of columns but don't know how to do it for the rows...
int cols = table[0].length;
int rows = ?;
How do I do that?
Can I just say...
int rows = table.length;
Why would that not give rows x cols?