title: Where is the return object of java substring method created?
body: <p>,the below code : </p>
  
  <pre><code>String str1 = "SachinTendulkar";
  String str2 = str1.substring(6, str1.length());
  String str3 = "Tendulkar";
  </code></pre>
  
  <p>the values in str2 and str3 are the same, but they do not refer to the same objects, what is exactly happening, where is str2 object created?</p>
  
  <p>Thanks in advance.</p>