C # in a little experience in inherited modifiers

xiaoxiao2021-03-06  90

Virtual / Override is a pair of modes, which need to use virtual definitions in the base class to be overloaded, and if you want to overload the function of the base class in the derived class, you need to use Override to explicitly define.

The abstract is used at the function level, indicating that this function does not provide the code in the base class, but must be implemented at the derived class. SeaD is just the opposite, if you don't want a function to be overloaded, you should use SeaD to live, not allowed to be reloaded.

For your second question, any function in Interface can not be implemented, and the Abstract class does not have this limit. In addition, using Interface can achieve multiple inheritance concepts, because the derived class specified in C # can only be inherited from 1 classes, but multiple interface can be implemented.

转载请注明原文地址:https://www.9cbs.com/read-107598.html

New Post(0)