If you have:
abstract class StaffMember implements MyInterface
where
interface MyInterface {
void myMethod();
}
then all of the classes extending StaffMember will inherit the type MyInterface, and you will be able to refer to them by this base type in other parts of the code where a MyInterface instance is expected as an operand/argument, for example:
void otherMethod(MyInterface param) { //... }
The actual implementation of the interface MyInterface can take place either in the abstract class, or in any of the classes extending the abstract class. The important thing is simply, in this case, that myMethod() is specified somewhere in the inheritance hierarchy, so that the JVM can find a definition of it to invoke.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…