1//Get rows size matrix
2matrix.length;
3//Get columns size of matrix
4matrix[0].length;
1public static void main(String[] args) {
2
3 int[][] foo = new int[][] {
4 new int[] { 1, 2, 3 },
5 new int[] { 1, 2, 3, 4},
6 };
7
8 System.out.println(foo.length); //2
9 System.out.println(foo[0].length); //3
10 System.out.println(foo[1].length); //4
11}