I am having issues with my subclasses and trying to make my function "method" generic, please see below, I am having issues implementing classes C1 and C2 to use my objects of type B1 and B2 respectively.
Edit: Sorry if it isn't clear, basically I am trying to override the function method, but I need the parameter to be generic, so for class C1 which is a subclass of C it should use B1 as a parameter and for C2 which is a subclass of C1 it should use B2 as a parameter.
The code the behavior that I am looking to achieve but I am struggling to make it compile.
Here are my classes
class A{}
class T1{}
class V1{}
abstract class B<T extends T1, V extends V1>{}
class B1 extends B<SomeChildOfT1, SomeChildOfV1>{}
class B2 extends B1{}
abstract class C <E extends B<? extends T1, ? extends T2>> extends A
{
void method(E)
{//bla}
}
class C1<E extends B1> extends C<B1>
{
//method with object B1 as parameter
@override
void method(E){
//bla
}
}
class C2 extends C2<B2>
{
@override
void method(B2)
{
}
}