On the usage of Java equality operator
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/513832/how-do-i-compare-strings-in-java">How do I compare strings in Java?</a>  </p>
</blockquote>



<pre><code>class StringTest {
public static void main(String[] args) {
String str1 = "Hi there";
String str2 = new String("Hi there");
System.out.println(str1 == str2);
System.out.println(str1.equals(str2));
}
</code></pre>

<p>The output is coming out: </p>

<pre><code>                          False
                          true  
</code></pre>

<p>Why the first output is false even when the str1 and str2 appear to be equal? </p>
