string "==" in java check the reference, why this code return true?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/4033625/if-compares-references-in-java-why-does-it-evaluate-to-true-with-these-string">If == compares references in Java, why does it evaluate to true with these Strings?</a><br>
  <a href="http://stackoverflow.com/questions/4744953/string-comparision-with-logical-operator-in-java">String comparision with logical operator in Java</a>  </p>
</blockquote>



<pre><code>public static void main(String[] args) 
{
  String a = "ab";
  final String bb = "b";
  String b = "a" + bb;
  System.out.println(a == b);
}
</code></pre>

<p>why it print true??</p>

<p>but,</p>

<pre><code>public static void main(String[] args)
{
  String a = "ab";
  String bb = "b";
  String b = "a" + bb;
  System.out.println(a==b)；
}
</code></pre>

<p>it print false.</p>
