Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Generic Question

 
Akhil Maharaj
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic