Can anyone point out to me what exactly is the difference between
AnyClass<T> and
AnyClass<? extends T>.
The scenario is I am creating a dynamic factory for one of my application, which shall create the instances of those class objects which is implementing my Parent Interface. The Use Case here is that I am storing all those Classes which has to come from this Factory in a Map<
String, Class> (not typesafe) which I am instantiating using reflection.
Assuming my Parent Interface is '
Ainterface' can I have a type safe Map of above as
Map<String, Class<Ainterface>> O
R Map<String, Class<? extends Ainterface>> OR
Both are fine?
Detailed Explanation shall be really helpful!!!
If am not clear, kindly let me know.