• Post Reply Bookmark Topic Watch Topic
  • New Topic

wild card  RSS feed

 
Ranch Hand
Posts: 296
  • 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..
 
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • 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 .
 
santhosh.R gowda
Ranch Hand
Posts: 296
  • 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

 
Ranch Hand
Posts: 46
  • 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
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
not cleared regarding wildcards thanks for reply
 
Marshal
Posts: 58436
178
  • 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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for all
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!