> 
> 
> What will be really fun is that, if you don't override equals() and
> hashcode() when you should, java collections won't work as expected.
> 
Uhm, no. Default implementation of equals is ==.

hashCode for two references to the same object will be equal. Thus, 
hashCode and equals are by default consistent with each other, hence 
collections will work fine if you don't override them. There's no 'when 
you should', either your object requires the different object-specific 
behaviour, or it doesn't, no rule of thumb, or generic behaviour to impose.


_______________________________________________
Eap-features mailing list
[EMAIL PROTECTED]
http://www.intellij.com/mailman/listinfo/eap-features

Reply via email to