title: There's a conceptual error in Java String method
body: <p>Here I was training to my OCP and test some String behaviors.</p>
  
  <p>And when i get this:</p>
  
  <pre><code>    System.out.println("a".substring(0) == "a".substring(0));  // true
  
      System.out.println("a".substring(0) == "aa".substring(1)); // false
  </code></pre>
  
  <p>Some doubts came to me. I know what that method returns is:</p>
  
  <pre><code>    return (beginIndex == 0) ? this : new String(value, beginIndex, subLen);
  </code></pre>
  
  <p>But, theres a conceptual error on this compiler rules or thats all ok?</p>