What is a sealed class in c# programming and why do we use this class in OPPs?
What is a sealed class in c# programming and why do we use this class in OPPs?
Software Developer
Hi, my self Ravi Vishwakarma. I have completed my studies at SPICBB Varanasi. now I completed MCA with 76% form Veer Bahadur Singh Purvanchal University Jaunpur. SWE @ MindStick | Software Engineer | Web Developer | .Net Developer | Web Developer | Backend Engineer | .NET Core Developer
In C# a sealed class is a class which is not allow to inherits itself in derived class. There are no derived class can create of sealed class. Declaring a sealed class must use sealed modifier. If we create derived of this class then c# compiler generate error.
Sealed class is used to restrict or remove the feature of inheritance in object oriented programming because it can not be inherited.