title: substring IndexOutOfBoundsException
body: <p>How come executing the following</p>
  
  <pre><code>String p = "abcd";
  System.out.print(p.substring(4));
  </code></pre>
  
  <p>Doesn't cause <code>java.lang.IndexOutOfBoundsException</code>? It just prints an empty String.</p>
  
  <p>There are nothing on <strong>p.charAt(4)</strong> and the following</p>
  
  <pre><code>System.out.print(p.charAt(4));
  </code></pre>
  
  <p>indeed causes <code>java.lang.IndexOutOfBoundsException</code>.</p>