Ken
== checks for the equality of object references, while .equals() checks
if two objects instances are equal. The catch is, not all classes override
the .equals() method and invoking this method on an instance calls the
default method provided by the Object class. The default method is
analogous to using the == operator. Thus programmers usually override
this method in their classes so that it can be used to check for instance
equality rather than reference equality.
A classic example is the String class where string1 == string2 does not
necessarily produce the same result as string1.equals(string2). Check if the
user defined classes in the code that you are looking at have overridden
the .equals() method.
-- Bali
"Ken K" <k...@kenkast.com> wrote in message
news:a6f4b7b2.04091...@posting.google.com...