String concatenation with operator + vs using stringbuffer?
<p>Is there any difference b/w 1 and 2 in terms of concatenation if i do it instance method. I mean in either case only one object will be constructed ultimately i.e "abc" .Yes only difference i see is  test will lie inside permgen space even thread come out of instance method but x will be garbage collected once thread is out of method but in terms of number of objects constructred will be same. Right?</p>

<pre><code>// option 1
String test="a"+"b"+"c";

// option 2  
StringBuffer x = new StringBuffer().append("a").append("b").append("c").toString()
</code></pre>

<p>I referred the link <a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/StringBuffer.html" rel="nofollow">http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/StringBuffer.html</a> to reach this conclusion.</p>
