Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > <?> vs <? extends Object>

Thread Tools

<?> vs <? extends Object>

Murat Tasan
Posts: n/a
what is the primary difference (other than clarity) between using these
two method declarations?

public void myMethod(Set<?> x);

public void myMethod(Set<? extends Object> x);

basically, during compile time, does every <?> get replaced with <?
extends X> where X is the upper bound found for the appropriate
class/interface reference?

i would think so, but i have seen some compilation warnings and errors
that have planted doubt in my mind.

unfortunately, i am having great difficulty in finding the appropriate
documentation regarding this... and i just don't have the time to
experiment enough to decode the differences.

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
extends multiple classes? Ian Stanley Java 13 03-13-2012 03:38 PM
Samba 3 extends lead over Win 2003....newbie or wannabe mcse's - get a clue! DaveT MCSE 8 11-05-2003 08:54 PM
TextArea in JScrollPane extends, not shrinks Miguel De Anda Java 0 08-13-2003 08:40 PM
[BEANSHELL] Extends SOl Java 0 07-19-2003 06:12 PM
Re: Properties2 extends Hashmap, pros and cons? Jon Skeet Java 5 07-08-2003 06:44 PM