S
Stefan Schulz
I think Chris is right. The equals method has to be symmetric, according
to the documentation. This means that superclass.equals(subclass) must
return false
I see it the other way around: The subclass must ensure it returns true
for whenever the
super class returns true.
usually i implement equals like this:
class Foo {
public boolean equals(Object o){
if (o instanceof Foo){
// do comparison, always return true, or don't return at all
}
return super.equals(o);
}
}