Originally posted by Matt Harrah:
The problem -- "why wasn't Hello World printed" -- is exactly what Guarav Singh pointed out - operator prcedence.
The + operator has higher precedence than the == operator. Because of this, the line:
System.out.println("Hello World!"+a==b);
is treated identically to
System.out.println(("Hello World!"+a)==b);
So, what gets printed is a comparison of two references. One reference is to the string "Hello World!abc" and the other reference is to the string "abc". The two references are unequal, so false gets printed. The contents of the strings never get compared or even considered in this example.
[ August 23, 2006: Message edited by: Matt Harrah ]
OOps I also missed that..???
BTW
UD you took at wrong direction
