I have the following Situation:
public interface A {
void doSomethingCool();
}
public interface B extends A {
void doSomethingVeryBCool();
}
public interface C extends A {
void doSomethingVeryCCool();
}
In my application I can only use classes implementing B or C. But there are parts of the code, where I want to use "a.doSomethingCool()", because I don't know (and don't care) which implementation is used.
Can I enforce, that there are only implementations of B and C? Or prevent the interface A from being implemented?