Convert output into a table
<p>I am using this method to print some data from a text file, and try to output it into a table format.
The first parameter simply requests a word that must be in the middle column, and the <code>colSize</code> should set the column width.</p>

<pre><code>public String printTable(String midWord, int colSize) {
    String col1 = "";
    String col2 = midWord;
    String col3 = "";

    System.out.printf( "%-15s %15s %n", col1, midWord, col3);
    //System.out.format ( "%-15s %15s %n", col1, midWord, col3);

    return null;
}
</code></pre>

<p>I have tried using both <code>printf</code> and <code>System.out.format</code> but they both seem to be doing the same thing so I am not sure about them.</p>

<p>Can anyone explain what I am missing in this method.</p>