Skip to content

"Sealed" Keyword

Mario Gutierrez edited this page Jan 7, 2017 · 1 revision

When applied to a class, the sealed modifier prevents other classes from inheriting from it.

sealed class MySealedClass { }

You can also use the sealed modifier on a method or property that overrides a virtual method or property in a base class. This enables you to allow classes to derive from your class and prevent them from overriding specific virtual methods or properties.

Clone this wiki locally