title: StringBuilder vs String concatenation in toString() in Java
body: <p>Given the 2 <code>toString()</code> implementations below, which one is preferred:</p>
  
  <pre><code>public String toString(){
      return "{a:"+ a + ", b:" + b + ", c: " + c +"}";
  }
  </code></pre>
  
  <p>or</p>
  
  <pre><code>public String toString(){
      StringBuilder sb = new StringBuilder(100);
      return sb.append("{a:").append(a)
            .append(", b:").append(b)
            .append(", c:").append(c)
            .append("}")
            .toString();
  }
  </code></pre>
  
  <p>?</p>
  
  <p>More importantly, given we have only 3 properties it might not make a difference, but at what point would you switch from <code>+</code> concat to  <code>StringBuilder</code>?</p>