It looks like you want to declare a generic type argument that you specify elsewhere. Wildcards make sense only when the type is used only once, and when declaring a generic type parameter for a class, it makes no sense.
Try this instead:
public class Foo<T extends SomeInterface> extends Bar<T> { public Foo(List<T> someInterfaceList) { super(someInterfaceList); } ... }
Since your code was written, the user had nothing to specify the generic type argument for Bar<> , since Foo itself was not a generic type.
In addition, if it were possible, it would be possible for the general argument Bar<> differ from the general argument List<> - until both types implemented by SomeInterface would have a problem compiling with these definitions, but could You get a much more confusing error message later when you mistakenly assumed that both types should be the same.
So, declare a generic type once as a generic argument to the Foo class, and then use that type ( T in my example) elsewhere to refer to this type, instead of accepting some new generic type argument that might not belong to one type.
source share