title: How many number of String objects created in below code?
body: <p>Am trying to find the number of String objects created in the below code.
  I think it is 4 because <code>String</code>s are immutable, so each of the first two lines in prod() method will create one object, and the third line will create 2 objects. So total 4 obejcts will be created. Could anybody clarify on that?</p>
  
  <pre><code>public class Solution {
  
      public void prod() {
          String str="Sku";
          str=str+"001";
          String skuId= str.substring(3,6);
          System.out.println(skuId.toString());
      }
      public static void main(String[] args) {
          new Solution().prod();
      }
  }
  </code></pre>