title: Counting String objects created by Java code
body: <p>How many String objects are created by the following code?</p>
  
  <pre><code>String x = new String("xyz");
  String y = "abc";
  x = x + y;
  </code></pre>
  
  <p>I have visited many websites where some say that this line of code creates 3 objects and some say it creates 4. I just wanted to know how many objects are created after this line of code is executed.</p>