Collection, which method is used to authorize an add of an element ?
Posted
by Duke Vador
on Stack Overflow
See other posts from Stack Overflow
or by Duke Vador
Published on 2010-05-22T10:10:33Z
Indexed on
2010/05/22
10:20 UTC
Read the original article
Hit count: 245
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.
© Stack Overflow or respective owner