Modifier: sealed

The sealed modifier is used to stop a class from being inherited or to stop a virtual method from being overridden.

Example:

class A {}
sealed class B : A {}
class C : B {}           // This will fail at compile time with CS0509

 


Discover more from

Subscribe to get the latest posts sent to your email.

Leave a comment

Trending