Java Array Output printArray(int[][] num)

Here you can find the source of printArray(int[][] num)

Description

print Array

License

Apache License

Declaration

public static void printArray(int[][] num) 

Method Source Code

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

public class Main {
    public static void printArray(int[][] num) {
        //int [][] num={{1,2,3},{4,5},{2}};
        for (int i = 0; i < num.length; i++) {
            for (int j = 0; j < num[i].length; j++)
                System.out.print(num[i][j] + "\t");
            System.out.println();
        }/*from  ww w .  j  a v  a2 s.  c o  m*/
    }

    public static void printArray(short[][] num) {
        //int [][] num={{1,2,3},{4,5},{2}};
        for (int i = 0; i < num.length; i++) {
            for (int j = 0; j < num[i].length; j++)
                System.out.print(num[i][j] + "\t");
            System.out.println();
        }
    }

    public static void printArray(int[] num) {
        for (int i = 0; i < num.length; i++) {
            System.out.print(num[i] + "\t");
        }
        System.out.println();
    }

    public static void printArray(long[] num) {
        for (int i = 0; i < num.length; i++) {
            System.out.print(num[i] + "\t");
        }
        System.out.println();
    }

    public static void printArray(double[] num) {
        for (int i = 0; i < num.length; i++) {
            System.out.print(num[i] + "\t");
        }
        System.out.println();
    }

    public static void printArray(boolean[][] bs) {
        for (int i = 0; i < bs.length; i++) {
            for (int j = 0; j < bs[i].length; j++) {
                if (bs[i][j])
                    System.out.print("1\t");
                else
                    System.out.print("0\t");
            }
            System.out.println();
        }
    }
}

Related

  1. printArray(float[] arr)
  2. printArray(int arr[])
  3. printArray(int[] arr)
  4. printArray(int[] array)
  5. printArray(int[][] array, String arrayLabel, String rowLabel, String columnLabel)
  6. printArray(Object array)
  7. printArray(Object[] arry, String specialText)
  8. printArray(Object[] data)
  9. printArray(Object[] in)