title: how the subString() function of string class works
body: <p>please see the following code.</p>
  
  <pre><code>String s = "Monday";
  if(s.subString(0,3).equals("Mon"){}
  
  String s2 = new String(s.subString(0,3));
  String s3 = s.subString(0,3);  
  </code></pre>
  
  <p>I know that line 2 will still point to "Monday" and have a new String object with the offset and count set to 0,3.</p>
  
  <p>The line 4 will create a new String "Mon" in string pool and point to it.</p>
  
  <p>But not sure what about line 5 whether it will behave like line 2 or line 4. </p>
  
  <p>If i am wrong for line 2 or 4 also please correct..</p>