C# - Sealed

Sealed Keyword

The sealed keyword enables you to prevent the inheritance of a class or certain class members that were previously marked virtual.

A sealed class cannot be used as a base class. For this reason, it cannot also be an abstract class. Sealed classes prevent derivation. Because they can never be used as a base class, some run-time optimizations can make calling sealed class members slightly faster.

public sealed class D
{
    // Class members here.
}

A method, indexer, property, or event, on a derived class that is overriding a virtual member of the base class can declare that member as sealed. This negates the virtual aspect of the member for any further derived class. This is accomplished by putting the sealed keyword before the override keyword in the class member declaration.

public class D : C
{
    public sealed override void DoWork() { }
}