title: Concatenate char literal ('x') vs single char string literal ("x")
body: <p>When I have a String that I need to concatenate a single char to its end,
  should I prefer <code>s = .... + ']'</code> over <code>s = .... + "]"</code> for any performance reason?</p>
  
  <p>I know array string joining and of String builders,
  and I am NOT asking for suggestions on how to concatenate strings in general.</p>
  
  <p>I also know some of would have the urge to explain to me about premature optimizations and that in general I should not bother with such minor stuff, please don't... </p>
  
  <p>I am asking because from a coding style preference I would prefer to use the later,
  but it feels to me that the first one should perform marginally better because knowing that what is being appended is just a single char there is no need for any internal looping going over this single char as there might be when copying a single character string.</p>
  
  <p><strong>Update</strong></p>
  
  <p>As @Scheintod wrote this is indeed a theoretical Q and has to do more with my desire to better understand how java works and less with any real life "lets save another microsecond" scenario...
  maybe I should have said that more clearly.</p>
  
  <p>I like understanding the way things work "behind the scenes" And I find that it can sometime help me create better code...</p>
  
  <p>The truth - I was not thinking about compiler optimizations at all...</p>
  
  <p>I would not have expected the JIT to use <code>StringBuilder</code>s instead of <code>String</code>s for me...
  Because I (possibly wrongly) think of String builders as being "heavier" then Strings on one hand but faster at building and modifying the strings on the other hand. So I would assume that in some cases using <code>StringBuilder</code>s would be even less efficient then using stings... (if that was not the case then the entire String class should have had its implementation changed to be such as that of a <code>StringBuilder</code> and use some internal representation for actual immutable strings... - or is that what the JIT is sort of doing? - assuming that for the general case it would probably be better not to let the developer choose... )</p>
  
  <p>If it Does change my code to such a degree then maybe My Q should have been at that level asking if its is appropriate for the JIT to do something like this and would it be better if it used.</p>
  
  <p>maybe I should start looking at compiled byte code... [I will need to learn how to do that in java ...]</p>
  
  <p>As a side note and example of why I would even consider looking at bytecode - have a look at a quite old blog post of mine about <a href="http://epeleg.blogspot.com/2008/04/optimizing-actionscript-20-bytecode.html" rel="noreferrer">Optimizing Actionscript 2.0 - a bytecode perspective - Part I</a> it shows that knowing what your code compiles into indeed can help you write better code.</p>