Difference Between Abstract Class and Sealed Class

Abstract Class :- Dictionary Meaning of Abstract is "Something that is Incomplete or Missing" but we are learning about the Abstract Class in the context of Programming. So we can say that Abstract Class is a Incomplete Class and it must be completed by others and it works as a Base Class. To make a Class Abstract we need to decorate that Class with Abstract Keyword as shown in Code Snippet. We can use Abstract keyword with Classes,Methods, Properties,Indexers and Events.

We can not Intantiate Abstract Class or we can say that we can not create a Object of Abstract Class by new Keyword. We only create a reference variable for it. An Abstract Class can contain Abstract and Non Abstract Members and it has implementation for some members.

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.

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

Sr.No Abstract Class Sealed Class
1 Using Abstract keyword we can create a Abstract Class Using Sealed keyword we can create a Sealed Class
2 Can not create a Object of Abstract Class directlty we need to create object of child classes. Can create a Instance of Sealed Class.
3 An Abstract class can contain Abstract and Non abstract Methods. Can contain Non abstract methods and do not contain Abstract and Virtual Methods
4 An Abstract class can be inherited by other classes. Can not inherited by other classes


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.