Collection, which method is used to authorize an add of an element ?
- by Duke Vador
We find a lot of concrete subclasses under Collection.
While trying to add an element in a concrete collection, this collection will use a method to determine if it can accept to store the element (and eventually that this element is not already in the collection).
It could use equals(), hashCode() or compareTo() of the element.
Is it possible to find a summary about which method is used by each implementation of Collection ?
Thanks a lot for your answers.