File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

wild card

 
santhosh.R gowda
Ranch Hand
Posts: 296
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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..
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
santhosh.R gowda wrote: so what is the use of using wildcard here..


To avoid the Compiler Warning .
 
Maneesh Godbole
Saloon Keeper
Posts: 10971
11
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
 
santhosh.R gowda
Ranch Hand
Posts: 296
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 46
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Maneesh Godbole
Saloon Keeper
Posts: 10971
11
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 296
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
not cleared regarding wildcards thanks for reply
 
Campbell Ritchie
Sheriff
Pie
Posts: 47229
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 296
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for all
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic