title: How many String objects would be created when concatenating multiple Strings?
body: <p>I was asked in an interview about the number of objects that will be created on the given problem:</p>
  
  <pre><code>String str1 = "First";
  String str2 = "Second";
  String str3 = "Third";
  String str4 = str1 + str2 + str3;
  </code></pre>
  
  <p>I answered that there would be <strong>6 objects</strong> created in the string pool.</p>
  
  <blockquote>
    <p>3 would be for each of the three variables.<br>
    1 would be for <code>str1 + str2</code> (let's say <code>str</code>).<br>
    1 would be for <code>str2 + str3</code>.<br>
    1 would be for the <code>str + str3</code> (<code>str = str1 + str2</code>).  </p>
  </blockquote>
  
  <p>Is the answer I gave correct? If not, what is the correct answer?</p>