title: Why is String's format(Object... args) defined as a static method?
body: <p>I wonder why <b>Java</b> 5 and above provide a printf-style formatter using a static method in class String like this:</p>
  
  <pre><code>public static String format(String format, Object... args)
  </code></pre>
  
  <p>instead of </p>
  
  <pre><code>public String format(Object... args)
  </code></pre>
  
  <p>so that we can write <code>"%02d".format(5)</code> to get <code>05</code> instead of <code>String.format("%02d", 5)</code>. </p>
  
  <p>I imagined if I could modify the String class, I could add this:</p>
  
  <pre><code>public String format(Object... args) {
      return format(this, args)
  }
  </code></pre>
  
  <p>to get the same result.</p>
  
  <p>I found that in C#, a static method is also used instead of an instance method.</p>
  
  <p>I wonder why they decided to do this, but I didn't come to an explanation. The instance methods <code>trim</code> and <code>substring</code> returns a new instance of string, so they should have done the same thing with <code>format</code>. </p>
  
  <p>Moreover, the <code>DateFormat</code> class also uses this:</p>
  
  <pre><code>public final String format(Date date)
  </code></pre>
  
  <p>for formatting dates. So if we consider the instance of DateFormat as the formatter, an instance of String could also be used as a formatter.</p>
  
  <p>Any ideas?</p>