Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

What is sealed class in c#?

user-image
Question ajoutée par Mohannad Bakbouk , Full Stack Web Developer , Almohtaseb
Date de publication: 2016/10/20
Pathan Zarrar Khadar Khan
par Pathan Zarrar Khadar Khan , Windows System Administrator , Dyce Tech Pvt Ltd

Sealed classes are used to restrict the inheritance feature of object oriented programming. Once a class is defined as a sealed class, the class cannot be inherited. In C#, the sealed modifier is used to define a class as sealed

Zeeshan Amjad
par Zeeshan Amjad , CTO

You can not inherit class form the seal class. If you know the Java then it is similar to "final class" in Java. Here is MDSN page for few examples. 

https://msdn.microsoft.com/en-us/library/88c54tsw.aspx

Shahid Riaz Qureshi
par Shahid Riaz Qureshi , Senior Software Engineer , Royal IHC

A class that cannot be inherited in order to protect it's functionality.

Muhammad Ali
par Muhammad Ali , Senior Software Engineer , TPS Pakistan

A sealed class is the one which can not be inherited by other classes.A class can be declared as sealed by using the keyword "sealed" in class declaration.

Bineesh VP
par Bineesh VP , Software Developer , Unknown

Seales class is the feature of OOP . A class cannot be inherited from outside scope.

sealed class is used to the define inheritance level of a class.sealed classes are used to restrict the inheritance feature in object oriented .it can be derived but it is not a base class .once a class is defined as a sealed class it cannot be inherited.

Javad Ahmadzadeh
par Javad Ahmadzadeh , Web Developer – Android Developer , Donyay-e Pardazesh-e Abri

When we define a class with "sealed" modifier, we cannot inherit it. It's equivalent to NonInheritable on VB.NET

Shahid Malik
par Shahid Malik , Senior Software Engineer , Capgemini India

Class is declared as Sealed in order to prevent it from being Inherited.

Nauman Zafar
par Nauman Zafar , Senior Software Engineer , Polymer DLP

C# offers a sealed keyword for protecting classes to be inherited. Why use Sealed classes ? You are implementing some security features using that particular class and don't want the object to be manipulated. Secondly, sealed keyword is an indication to Common Language Runtime (CLR) that there are no sub-classes to look down which further increases overall performance if properly used.

Ziauddin Zia
par Ziauddin Zia , Software Engineer , Asia Poultry Feeds (Pvt) Ltd

Sealed, as is name indicates lock the class from inheritance.

So simple is that sealed classes cannot be inherited.

Ubaid sayeed Mohd abdul sayeed
par Ubaid sayeed Mohd abdul sayeed , Senior Programmer , Moksha solutions

restrict the inheritance feature of object oriented programming.

Avez-vous besoin d'aide pour créer un CV ayant les mots-clés recherchés par les employeurs?