如何在不通过接口实现功能的情况下将实现转发给子类?
interface A { void function f();}
class B implements A {/* some functions and attributes **/
@Override
void function f(){/* empty , i don't need it*/}
}
class C extends B{
@Override
void function f(){/* implementation*/}
}
class D extends B{
@Override
void function f(){/* implementation*/}
}
当我也需要实例化它时,如何删除B类中的替代?