aspose file tools*
The moose likes Beginning Java and the fly likes wild card Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "wild card" Watch "wild card" New topic
Author

wild card

santhosh.R gowda
Ranch Hand

Joined: Apr 06, 2009
Posts: 296

i had one doubt even if we drop <?> in getList method the code will compile and runs... so what is the use of using wildcard here..


Creativity is nothing but Breaking Rules
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

santhosh.R gowda wrote: so what is the use of using wildcard here..


To avoid the Compiler Warning .
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10375
    
    8

Recommended reading
http://java.sun.com/j2se/1.5.0/docs/guide/language/generics.html

[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
santhosh.R gowda
Ranch Hand

Joined: Apr 06, 2009
Posts: 296
to avoid compiler warning


hi maneesh as you have given the link to refer only genrics regarding topics are there. but thet have not given any wild card please send me the link regarding wild card

Arka Guhathakurta
Ranch Hand

Joined: Mar 01, 2009
Posts: 46
If you want to learn about wild cards read this link. It will clear your doubt.

Note that <?> and <? extends Object> behaves similarly in nearly all scenarios. Also note that the add method of list is not compatible with these two.


regards,
Arka
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10375
    
    8

santhosh.R gowda wrote:
to avoid compiler warning


hi maneesh as you have given the link to refer only genrics regarding topics are there. but thet have not given any wild card please send me the link regarding wild card



If you had bothered to scroll down to the end of the page you would have found the link to the Generics tutorial which does contain information regarding wild cards.

Your access to Google is blocked for some reason?
http://faq.javaranch.com/java/ShowSomeEffort
http://faq.javaranch.com/java/SearchFirst
santhosh.R gowda
Ranch Hand

Joined: Apr 06, 2009
Posts: 296
not cleared regarding wildcards thanks for reply
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38851
    
  23
Please explain: could you not find the wildcard section, or could you find it and not understand it?

It is worthwhile searching for "Angelika Langer Java Generics"; she has a very nice set of FAQ about generics.
santhosh.R gowda
Ranch Hand

Joined: Apr 06, 2009
Posts: 296
thanks for all
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: wild card