public class MyClass {
public static void main(String args[]) {
int[][] matrix = {
{2, 0, 5, 9},
{0, 4, 0, 3},
{0, 8, 0, 1}
};
int rows = matrix.length;
int cols = matrix[0].length;
System.out.println("rows: " + rows);
System.out.println("cols: " + cols);
}
}
/*
run:
rows: 3
cols: 4
*/