In theory, the input paramters in a subclass method should be equivaent to or less restrictive than the input parameters of the superclass (contravariant).
What I want to do is basically create a class A that has a generic binding <T extends SomeType>, but then create a subclass B, with no generic binding (should allow any type) <T>:
class A<T extends SomeType> {....}
class B<T> extends A<T extends SomeType> { ..... }
Is this even possible in java or ever right from a theoretic point of view?
No, that isn’t correct. Consider a method declared in
Athat returnsT:An object statically typed as
Awould be expected to conform to the bounds declared by that class:But then if
Bdoes away with those bounds:We have chaos: