title: Can I use a conditional statement in a printf statement?
body: <p>My code contains a switch statement, and in all cases there are if else statements. They are all pretty short so I was thinking about condensing the code by turning them into conditional statements. The format I was going for was...</p>
  
  <pre><code>System.out.printf( (conditional-Statement ) );
  </code></pre>
  
  <p>Here is my if else statement for one of the cases...</p>
  
  <pre><code>    if (count == 1) {
          System.out.printf("%3d", count);
      } else {
          System.out.printf("%11d", count);
      }
  </code></pre>
  
  <p>Something like...</p>
  
  <pre><code>System.out.print((count == 1) ? count : "  " + count);
  </code></pre>
  
  <p>does not produce syntax errors, </p>
  
  <p>but it all messed up when I did...</p>
  
  <pre><code>System.out.printf((count == 1) ?  "%3d", count : "%11d", count);
  </code></pre>
  
  <p>Is what I am trying to do possible?</p>