title: Is it correct to call java.lang.String immutable?
body: <p><a href="http://docs.oracle.com/javase/tutorial/essential/concurrency/immutable.html" rel="noreferrer">This Java tutorial</a>
  says that an immutable object cannot change its state after creation. </p>
  
  <p><code>java.lang.String</code> has a field</p>
  
  <pre><code>/** Cache the hash code for the string */
  private int hash; // Default to 0
  </code></pre>
  
  <p>which is initialized on the first call of the <code>hashCode()</code> method, so it changes after creation:</p>
  
  <pre><code>    String s = new String(new char[] {' '});
      Field hash = s.getClass().getDeclaredField("hash");
      hash.setAccessible(true);
      System.out.println(hash.get(s));
      s.hashCode();
      System.out.println(hash.get(s));
  </code></pre>
  
  <p>output</p>
  
  <pre><code>0
  32
  </code></pre>
  
  <p>Is it correct to call <code>String</code> immutable?</p>