title: Printwriter not outputing leading zeros to text file
body: <p>So this code I'm trying to output to text file in a certain format so that when I load it it wont have any problems. I'm using <code>String.format("%02d", 5)</code> to output <code>05</code> instead of just <code>5</code>. This works in console but when outputing to text file it seems to output as 5 not 05. Why is this happening?</p>
  
  <pre><code>PrintWriter output = new PrintWriter(scheduleFile);
  
  for (int i = 0; i &lt; getSchedule().length; i++) {
      for (int j = 0; j &lt; getSchedule()[i].length; j++) {
          output.print(j + ":00-" + (j + 1) + ":00     =");
          if (getSchedule()[i][j] != null) { // if not null
              output.print(String.format("%02d", (j)) + ":00-" + String.format("%02d", (j+1)) + ":00     "); // print hours
          }
          output.println();
      }
  }
  </code></pre>
  
  <p>Text file looks like this:  </p>
  
  <pre><code>0:00-1:00     =  
  1:00-2:00     =  
  2:00-3:00     =  
  3:00-4:00     =  
  4:00-5:00     =  
  5:00-6:00     =  
  6:00-7:00     =  
  7:00-8:00     =  
  8:00-9:00     =  
  9:00-10:00     =  
  .  
  .  
  .  
  </code></pre>
  
  <p>should look like this:  </p>
  
  <pre><code>00:00-01:00     =  
  01:00-02:00     =  
  02:00-03:00     =  
  03:00-04:00     =  
  04:00-05:00     =  
  05:00-06:00     =  
  06:00-07:00     =  
  07:00-08:00     =  
  08:00-09:00     =  
  09:00-10:00     =   
  .  
  .  
  .  
  </code></pre>