How "==" works for objects?
<pre><code>public static void main(String [] a)
{
 String s = new String("Hai");
 String s1=s;
 String s2="Hai";
 String s3="Hai";
 System.out.println(s.hashCode());
 System.out.println(s1.hashCode());
 System.out.println(s2.hashCode());
 System.out.println(s3.hashCode());
 System.out.println(s==s2);
 System.out.println(s2==s3);

}
</code></pre>

<p>From the above code can anyone explain what is going behind when JVM encounters this line (s==s2) ? </p>
