I have the following two classes:
class SomeClassA<F extends E> { }
class SomeClassB<? extends E> { }
What is the difference and the limitation between SomeClassA and SomeClassB?
I have the following two classes:
class SomeClassA<F extends E> { }
class SomeClassB<? extends E> { }
What is the difference and the limitation between SomeClassA and SomeClassB?
It may gives you some idea
class SomeClassB<? extends E> { }
:
A
class with an unbounded type parameter. Its elements are of a specific, but unknown, type. The elements must all be the same type.
class SomeClassA<F extends E> { }
:
A
class with a type parameter called F
. The supplied type for F
must be of a type that extends E
, or it is not a valid type for the parameter.