Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

STRING HANDLING IN JAVA

807607Feb 2 2007 — edited Feb 2 2007
String a="java";
String b="java";

a==b gives an output "true"


Why does this happen,when we know that == operator compares two object references whether they refer to the same object and in this case a and b are two different object references.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 2 2007
Added on Feb 2 2007
1 comment
165 views