I have just seen this code and I cannot see what is the benefit of defining a class in this way. Can anyone explain me why/when we use this notation?
At first I thought that an instance of ClassW would allow you to access methods from ClassB and ClassC but I see it doesn't. It is just a notation... but why?
class ClassW extends ClassZ {
}
abstract class ClassZ extends ClassA<ClassB, ClassC> {
}
class ClassA<B extends ClassB, C extends ClassC> {
B b;
C c;
}
abstract class ClassB {
public abstract void isB();
}
abstract class ClassC {
public abstract void isC();
}