Sealed classes are used to restrict the inheritance feature of object oriented programming.
ÃÂ· Once class is defined as sealed class, this class cannot be inherited so we can't derive class.
ÃÂ· Keywords: C# - Sealed , VB.NET - NotInheritable
ÃÂ· If you have ever noticed, struct are sealed. You cannot derive a class from a struct.
ÃÂ· A sealed class cannot be used as a base class. For this reason, it cannot also be an abstract class.
ÃÂ· The best usage of sealed classes is when you have a class with static members.
ÃÂ· Example - The Pens and Brushes classes of the System.Drawing namespace. The Pens class represent the pens for standard colors. This class has only static members. Pens.Blue represents a pen with blue color. Similarly, the Brushes class represents standard brushes. The Brushes.Blue represents a brush with blue color.