A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Programmer Certification (SCJP/OCPJP)
Java 5 -Collection
Joined: Feb 27, 2002
Dec 30, 2004 00:32:00
I want to know why the following Collection<E> interface methods, accept Collection<?> as the parameter and not Collection<? super E>
boolean containsAll(Collection<?> c)
boolean removeAll(Collection<?> c)
boolean retainAll(Collection<?> c)
If I create a Collection<
>, does invoking c.containsAll(m) (where m is Collection<Map>
make sense? :roll: I dont think so. Could someone explain?
Joined: Aug 03, 2002
Dec 30, 2004 01:39:00
I'm moving this to...
Java In General (Advanced)
[ December 30, 2004: Message edited by: Barry Gaunt ]
Ask a Meaningful Question
Getting someone to think and try something out is much more useful than just telling them the answer.
I agree. Here's the link:
subject: Java 5 -Collection
Question about generics
Collections / Generics Question
Questions on Collection Interface.
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015