Virtual function inheritance

后端 未结 3 2161
忘掉有多难
忘掉有多难 2021-02-20 00:20

I have a confusion about the inheriting the virtual property of a method.

Let\'s suppose we have 4 classes: class A, class B, class C and class D. The classes are inheri

3条回答
  •  爱一瞬间的悲伤
    2021-02-20 00:38

    Of course you can do it. Virtual method is optional to override so it doesn't matter that you declare it in class A or B. If you dont want to use that method in class A then simply declare in in class B.

提交回复
热议问题