Java Matrix Print printMatrix(int[][] target)

Here you can find the source of printMatrix(int[][] target)

Description

print Matrix

License

Apache License

Declaration

public static void printMatrix(int[][] target) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {

    public static void printMatrix(int[][] target) {
        if (target == null) {
            System.out.println("NULL");
            return;
        }/*from   w ww .jav a 2s .  c  om*/

        int n = target.length;
        for (int i = 0; i < n; i++) {
            int m = target[i].length;
            for (int j = 0; j < m; j++) {
                System.out.print(target[i][j]);
                System.out.print(" ");
            }
            System.out.println("");
        }
    }
}

Related

  1. printMatrix(int matrix[][])
  2. printMatrix(int[] array, String format, int width)
  3. printMatrix(int[][] M)
  4. printMatrix(int[][] matrix)
  5. printMatrix(int[][] s)
  6. printMatrix(Object[][] matrix)
  7. printMatrix(Object[][] matrix)
  8. printMatrix(Object[][] matrix)
  9. printMatrix(PrintStream out, double[][] matrix)