title: Format String Output Variable Java
body: <p>I am trying to create my output to look like a table in Java. Is it possible to create a standard format that I use for all my output? So far I have?</p>
  
  <pre><code>String format = String.format("%-3s%-3s\n");
  
  System.out.printf(format, "foo", "bar");
  </code></pre>
  
  <p>When I am currently trying this with different input and creating my format for use within a for loop I am getting an error saying:</p>
  
  <p>Exception in thread "main" java.util.MissingFormatArgumentException: Format specifier '%-3s'</p>
  
  <p>Any help is greatly appreciated.</p>