• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Generic Question

 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Fellow Ranchers ,

Can you explain

method1 and method2 - do they provide same functionality ?

method3 and method 4 - do they provide same functionality ?
Line 3 gives compile error

can anybody explaing line1 - line please ?


 
Akhil Maharaj
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
All ,

I think I found the answer at
http://www.angelikalanger.com/GenericsFAQ/FAQSections/TypeArguments.html#FAQ203

Line 1 and Line 2 are same.
Line 3 Is not allowed by compiler . Type parameters Can not have lower bound .

Line 4 is same as Line 1 . Except that You can add Animals to List
(This we all know ).

The major question was Line 3 . I think I have to sink in the fact that Type parameters Can not have lower bound .

Any more ideas are welcome
 
I carry this gun in case a vending machine doesn't give me my fritos. This gun and this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic