Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Eraserhead

macrumors G4
Original poster
Nov 3, 2005
10,434
12,250
UK
I know that to calculate the size of a 1D matrix in Java you use .length (so if you create a vector v using
Code:
int [] v= new int [3];
System.out.println(v.length);

It will print 3, but if I have a matrix A
Code:
int [][] A=new int[3][4];
System.out.println(A.length);
It will also print 3, but how do you get it to print the other dimension (in this case 4)?

Thanks
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.