sealed types and methods. : sealed « Class « C# / CSharp Tutorial






To prevent a class from being inherited, precede its declaration with sealed.

sealed class FooSealed {}

class BaseClass
{
    protected virtual void Bar() { /*...*/ }
}

class Derived : BaseClass
{
    protected override sealed void Bar() { /* ... */ }
}








7.37.sealed
7.37.1.Sealed methods
7.37.2.sealed types and methods.
7.37.3.Sealed Classes
7.37.4.internal sealed class