Difference Between Sealed and Static in C#

Sealed Class :- Sealed Class is a special Class in C# widely used in Software Design Patterns and it restricts classes to inherit the Sealed Class, In simple word we can say that no other classes will inherit the Sealed Class. It is widely used in Singleton Design Patterns.

Static Class :- Static Class is a class in which all the members of Class should be Static and we can not create an instance of Static Class using New Keyword.You can access all the members of Static Class by Class Name directly.

Below is the Tabular Representation of the Differences in Static Class and Sealed Class.

Sr.No Static Class Sealed Class
1 Using Static keyword we can create a Static Class Using Sealed keyword we can create a Sealed Class
2 Can not create a Object of Static Class Can create a Instance of Sealed Class.
3 Can not inherit Static Classes by other classes Can not inherit Sealed Classes by other classes
4 Static Class can not implement the Interface. Sealed Class can implement the Interface..
5 Can not pass Static Class in Method Parameters. Can pass Sealed Class object in Method Parameters.
6 We can not use Static Class as a return type of methods. We can use Sealed Class as a return type of methods.
7 It contains Static Members only. It may have Static and Non Static members.
8 It can have Static Constructor Only. It can have Static and Non Static Constructors.
9 Can not use Modifier with Static Constructors. We can use modifiers with Sealed Class constructors.
10 Static Class has only parameterless constructor. Sealed class may constructor with Parameter and Parameterless also.
11 It does not support the Object Disposal. It supports the Object Disposal.
11 We can access Static Class members using the Class Name. We can access Sealed Class members using objects.


Image is not available

About the Author
Sudheer Singh Chouhan is a Software Engineer having Expertise in Development Design and Architecting the applications , Project Management , Designing Large Scale Databases in SQL Server since last 17 Years.
Skill Sets :- Microsoft .NET technologies like ASP.Net Core, Web API, LINQ, Web Forms, WinForms, SQL Server, EntityFramework, Design Patterns, Solid Principles, Microservices, AWS Cloud.