Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

how to print elements in matrix java

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();
        }
    }
 
PREVIOUS NEXT
Tagged: #print #elements #matrix #java
ADD COMMENT
Topic
Name
7+4 =