Possible Duplicates:
Getting strange output when printing result of a string comparison
Hi all,
System.out.println()
behaving in a different way with strings.
Can any one explain why
See the below code snippet
String a ="hello"
String b ="hello"
System.out.println("a==b"+"is"+a==b)
I expect this to print 'a==b is true'
, but it just prints false
and I dont know why.