| title | NotOverridable (Visual Basic) | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| ms.date | 07/20/2015 | ||||||||||
| ms.prod | .net | ||||||||||
| ms.suite | |||||||||||
| ms.technology |
|
||||||||||
| ms.topic | article | ||||||||||
| f1_keywords |
|
||||||||||
| helpviewer_keywords |
|
||||||||||
| ms.assetid | 66ec6984-f5f5-4857-b362-6a3907aaf9e0 | ||||||||||
| caps.latest.revision | 15 | ||||||||||
| author | dotnet-bot | ||||||||||
| ms.author | dotnetcontent |
Specifies that a property or procedure cannot be overridden in a derived class.
The NotOverridable modifier prevents a property or method from being overridden in a derived class. The Overridable modifier allows a property or method in a class to be overridden in a derived class. For more information, see Inheritance Basics.
If the Overridable or NotOverridable modifier is not specified, the default setting depends on whether the property or method overrides a base class property or method. If the property or method overrides a base class property or method, the default setting is Overridable; otherwise, it is NotOverridable.
An element that cannot be overridden is sometimes called a sealed element.
You can use NotOverridable only in a property or procedure declaration statement. You can specify NotOverridable only on a property or procedure that overrides another property or procedure, that is, only in combination with Overrides.
You cannot specify Overridable or NotOverridable for a Private method.
You cannot specify NotOverridable together with MustOverride, Overridable, or Shared in the same declaration.
The NotOverridable modifier can be used in these contexts:
Modifiers
Inheritance Basics
MustOverride
Overridable
Overrides
Keywords
Shadowing in Visual Basic