aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Generic Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Generic Question" Watch "Generic Question" New topic
Author

Generic Question

Akhil Maharaj
Ranch Hand

Joined: Sep 29, 2007
Posts: 63
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

Joined: Sep 29, 2007
Posts: 63
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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Generic Question