previous | start

The printArray2 method

The spacing in the output is due to the printf statement at line 6:

    1   
    2     public static void printArray2(char a[][])
    3     {
    4       for(int i = 0; i < a.length; i++) {
    5         for(int j = 0; j < a[0].length; j++) {
    6           System.out.printf("%3c", a[i][j]);
    7         }
    8         System.out.println();
    9       }
   10     }

Sample output:

  B  O  L  F  K
  V  R  W  H  R
  C  D  C  M  Q

   


previous | start