Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Set<?> (The method add(capture-of ?) in the type Set<capture-of ?> ...)

843793Jan 31 2006 — edited Feb 1 2006
I have a static method wich accepts a generic Set<?> someSet
public static void testSetGeneric(Set<?> someSet){
    	someSet.add("something");
    	
 }
I get a compilation error:
The method add(capture-of ?) in the type Set<capture-of ?> is not applicable for the arguments
(String)

what do I do wrong?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 1 2006
Added on Jan 31 2006
4 comments
263 views