Dhivya rajagopal wrote:My doubt is how the output for s2==s3 becomes false?
can you please explain
String is an object. When comparing objects,
you should always use
equals() unless, as Campbell said, you want to know if two objects are the
the same object.
At it's worst (ie, if the object doesn't have its own
equals() method) it will do the same thing as '==', but if, like String, it has some other meaning, it will do what you expect; '==' won't.
Winston