If class A has a virtual method and then class B which is subclasses A, overrides that method. Then class C subclasses B. So now C is supposed to inherit B's overriden method, and not A's virtual method. Then if C wants to override B's one it can't because B's method can't be both virtual and override. I guess all inherited classes inherit virtual method from the grand-parent node in object graph in this case and not their parent node. But this seems counter-intuitive. Someone is supposed to inherit something from the parent not grandparent.

If class A has a virtual method and then class B which is subclasses A, overrides that method. Then class C subclasses B. So now C is supposed to inherit B's overriden method, and not A's virtual method. Then if C wants to override B's one it can't because B's method can't be both virtual and override. I guess all inherited classes inherit virtual method from the grand-parent node in object graph in this case and not their parent node. But this seems counter-intuitive. Someone is supposed to inherit something from the parent not grandparent.

From the Programming Police:

You cannot use the virtual modifier with the following modifiers:

static abstract override

BUT! A virtual inherited property can be overridden in a derived class by including a property declaration that uses the override modifier.

SOURCE


If this answers your question, please mark the thread as solved. Happy programming!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.