#Csharp sealedclass sealedmethod interviewquestionsandanswers
Explore tagged Tumblr posts
Link
Sealing is often used to encapsulate a logic that needs to be used across the application but without any alteration to it. A sealed class is used to define the inheritance level of a class. You can restrict a class from inheritance for security reasons in C# by declaring it a sealed class.
In C# sealed keyword applies restrictions on the class, method, property, indexer or event. If you create a sealed class, it cannot be derived. If you create a sealed method, it cannot be overridden. In C#, we can use a sealed keyword before or after the access modifier to define the class as sealed classes.
1 note
·
View note