what is the difference between the 2 cases; in java strings? : <p>why do these statements give different answers?</p>

<pre><code>String s1="hello world";
String s2="hello world";
 System.out.println(s1.equals(s2));//true
    System.out.println(s1 == s2);//true
</code></pre>

<p>2nd case;</p>

<pre><code>String s1=new String("hello world");
String s2=new String("hello world");
 System.out.println(s1.equals(s2));//true
    System.out.println(s1 == s2);//false
</code></pre>
