Java / Generics
What is Bounded wild-cards in Generics?
Bounded Wildcards impose bound on Type.
There are two types of Bounded wild-cards.
- <? extends T>
- <? super T>
Bounded wildcards are specified by List<? extends SuperClassType>
Bounded wildcards <? extends T> which impose an upper bound by ensuring that type must be sub class of T.
<? super T> imposes lower bound by ensuring Type must be super class of T.
More Related questions...