In java "string" == "string" is false why?
<p>The following statement appears in Section <a href="http://docs.oracle.com/javase/specs/jls/se7/html/jls-3.html#jls-3.10.5JLS" rel="nofollow">3.10.5. String Literals</a> of the <a href="http://docs.oracle.com/javase/specs/jls/se7/html/index.html" rel="nofollow">Java Language Specification</a>:</p>

<blockquote>
  <p>A string literal always refers to the same instance of class String.
  This is because string literals - or, more generally, strings that are
  the values of constant expressions (§15.28) - are "interned" so as to
  share unique instances, using the method String.intern.</p>
</blockquote>

<p>I am using Java JDK 7 and Eclipse indigo.</p>

<p>and my test program is as follows:</p>

<pre><code>public class Main {

    public static void main(String[] args) {
        String s1 = "string";
        String s2 = "string";

        System.out.print(s1 == s2); // true
        System.out.print(" , " + "string" == "string"); // false
    }

}
</code></pre>
