1public class Main {
2 public static void main(String[] args) {
3 int[][] test = new int[10][4];
4 int rows = test.length;
5 int coloumns = test[0].length;
6 System.out.println(rows);
7 System.out.println(coloumns);
8 }
9}
1 int[][] test;
2 test = new int[5][10];
3
4 int row = test.length;
5 int col = test[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}
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 // gives count of rows
9 System.out.println(foo[0].length); //3 // gives count of columns for particular row
10 System.out.println(foo[1].length); //4
11}