May 2010
Intermediate to advanced
1272 pages
61h 18m
English
NotOverridable KeywordYou can mark an overridden method or property as NotOverridable so that derived classes cannot override them again. The NotOverridable keyword cannot be used versus methods or properties that do not override a base member. Continuing the example of the Contact class previously defined, the NotOverridable keyword can be used as follows:
![]()
In this way the FullName method within the Contact class overrides the base class, but derived classes cannot override it again. Basically NotOverridable is used only within derived classes that override base class’s members, because in a base class the default behavior for members is that ...
Read now
Unlock full access