📜  如何在矩阵java代码示例中打印元素

📅  最后修改于: 2022-03-11 14:52:25.843000             🧑  作者: Mango

代码示例2
public static void printMatrix(Object[][] matrix){
        for (int i = 0; i < matrix.lenght ; i++) {
            for (int j = 0; j < matrix.lenght; j++) {
                System.out.print(matrix[i][j] + " ");
            }
            System.out.println();
        }
    }