What is the use of 'abstract override' in C#?

前端 未结 7 968
梦如初夏
梦如初夏 2020-11-27 17:44

Just out of curiosity I tried overriding a abstract method in base class, and method the implementation abstract. As below:

public abstract class FirstAbstra         


        
相关标签:
7条回答
  • 2020-11-27 18:37

    If you did not declare SomeMethod as abstract override in SecondAbstract, the compiler would expect that class to contain an implementation of the method. With abstract override it is clear that the implementation should be in a class derived from SecondAbstract and not in SecondAbstract itself.

    Hope this helps...

    0 讨论(0)
提交回复
热议问题