A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Programmer Certification (SCJP/OCPJP)
Help in generics
Joined: Feb 12, 2010
May 12, 2010 05:34:26
Hi, Could someone please help me understand the below concept :
<Animal> can accept references of type Dog, Cat, or any other subtype of Animal (subclass, or if Animal is an interface, implementation)."
Additionally could someone please point me to understand any good link for understanding the concepts used in Generics.
Joined: Jul 29, 2008
May 12, 2010 06:13:23
In simple terms, if there is a reference like "
", you can add a dog, cat,
, or any other animal into that object, using the add(-) method. You may have a look at the Sun
Author of ExamLab
- a free SCJP / OCPJP exam simulator
What would SCJP exam questions look like?
How to Ask a Question
Joined: Oct 13, 2009
May 12, 2010 07:15:18
Hope this helps,
Follow me on Twitter
When you score low in mocks
Did you see how Paul
cut 87% off of his electric heat bill with 82 watts of micro heaters
subject: Help in generics
Generics + Polymorphism
wildcards in generics
Generics doubt ?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015