Thanks Ajit......
I agree with it, and understand that all primitive datatypes can be compared using == and object references should be compared using equals.
I have one more question.......Where does string belong to. I understand that it is a literal(constant), and we also have a string class.. But from the book of moughal it says that yu can compare a string literal to a string object but not with ==
Here is an example
Ajith. I have two doubts here.......
1. Where does a literal(any literal-int,boolean,string etc)belong to.. Is it belonging to primitive datatypes? If yes then why do we have literals in the first place.... Can't we do without it..
2. In this example why cant we compare a string literal to an object reference in (1)? Why is it giving false... and why it is giving true at (2)...........
Mysterious strings.........
AVNI