r/javahelp • • Aug 04 '25
Wildcards question
For example:
class Parent<T> {}And now we make a subclass:
class Child<T extends Number> extends Parent<T>Are these two statements equivalent?
Child<?> child1
Child<? extends Number> child2Obviously, java automatically converts <?> to <? extends Object> but is this case when there is a bounded type parameter does it convert it to ? extends Bound (in this case <? extends Number>)?
3
Upvotes
View all comments
Show parent comment
2
u/[deleted] Aug 04 '25
Thanks, also do you know a strategy to understand more complex generics easier? I understand generics but when its stacked up its gets more complex