title: print formatting in java (Array/For Loops)
body: <p>This is my first program in java. For the life of me no matter what I do. It won't won't won't work. :(</p>
  
  <p>Here is my method that I am outputting information in. </p>
  
  <pre><code>private static int showAll(int[] order, String[] name, int last) 
  {
  int end = order.length;
  
  
  System.out.println("     " + "The Godfather's Pizza" + "     " + "\n" 
  + "**********************************" 
  + "\n     Order Number" + "    Customer\n     -----------     ---------\n");
  
  
      for (int i = 0; i &lt; order.length; i++) 
  
  
          {
  
          System.out.printf("%6d %6d%s" + order[i] + name[i]);
  
  
              end = end + 1;
          }      
  
  System.out.println("\n          End of Report");
  
  
  
  return end;
  }
  </code></pre>
  
  <p>Here is an example of my output:</p>
  
  <pre><code>    The Godfather's Pizza     
  **********************************
   Order Number    Customer
   -----------     ---------
  
    0              null
    0              null
    0              null
    0              null
    0              null
  
        End of Report
  </code></pre>
  
  <p>My question is... how do I format my outputs? I know how to in other programming languages and didn't think it would be such a pain? </p>
  
  <pre><code>System.out.printf("%6d %6d%s" + order[i] + name[i]);
  </code></pre>