An abstract class is declared as
myClass<E extends Number, D extends Number>
Sublasses are
final mySubClass<Double,Integer>
final myOtherSubclass<Double,Double>
Imagine there is a subclass that will not have a parametrized procedure for the first type, I mean, type would be ignored. Is there any way to set it to Void, Null or something?
final mySubClassThatDontUseFirstType<Void,Integer>
For example, if it had a inner List<E> inside, this list would be List because would be never used.
No, not really. What ever you choose it needs to be a subtype of
Number(that’s simply a requirement of the Java Language).What you could do is to create an uninstantiable class
VoidNumberand use that to document the fact that it’s not used.