Okay, so basically I have the following problem: I'm trying to have an abstract class inherit from another abstract class that has an abstract method, but I don't want to implement an abstract method in either of them, because the third class inherits from both of them:
public abstract class Command { public abstract object execute(); } public abstract class Binary : Command { public abstract object execute();
I am trying to separate binary commands from unary commands, but I donβt want / cannot implement the execute method anyway. I thought that Binary overrides the abstract method (as needed) and then just throws an unrealized exception. If I redefine it, then I must declare the body, but if I make it abstract, then I "hide" the inherited method.
Any thoughts?
inheritance c # abstract-class abstract-methods
thed0ctor
source share