Why do we have contains(Object o) instead of contains(E e)?

Posted by Vivin Paliath on Stack Overflow See other posts from Stack Overflow or by Vivin Paliath
Published on 2010-06-08T00:43:44Z Indexed on 2010/06/08 0:52 UTC
Read the original article Hit count: 294

Filed under:
|
|
|

Is it to maintain backwards compatibility with older (un-genericized) versions of Collection? Or is there a more subtle detail that I am missing? I see this pattern repeated in remove also (remove(Object o)), but add is genericized as add(E e).

© Stack Overflow or respective owner

Related posts about java

Related posts about generics