title: How to format numbers with leading spaces in Java
body: <p>I have the following Java codes to generate numbers padded by zeroes.</p>
  
  <pre><code>    DecimalFormat fmt = new DecimalFormat("000");
      for (int y=1; y&lt;12; y++)
      {
          System.out.print(fmt.format(y) + " ");
      }
  </code></pre>
  
  <p>The output is as follows:</p>
  
  <p><code>001 002 003 004 005 006 007 008 009 010 011</code></p>
  
  <p>My question is: how do I generate numbers with padded spaces instead of leading zeroes?</p>
  
  <p><code>1   2   3   4   5   6   7   8   9  10  11</code></p>
  
  <p>Note: I know there are several quesitons achieved in StackOverflow asking for padding spaces in String. I know how to do it with String. I am asking is it possible to format <strong>NUMBERS</strong> with padded space?</p>