public class MyClass {
public static void main(String args[]) {
int[][] arr = {{31, 22, 33, 4},
{42, 85, 987, 9},
{12, 99, 5, 1}};
System.out.println("rows: " + arr.length);
System.out.println("cols: " + arr[0].length);
}
}
/*
run:
rows: 3
cols: 4
*/