What are Sealed Classes in C#?

Answer Posted / gpriya

A sealed class cannot be inherited. It is an error to use a
sealed class as a base class. Use the sealed modifier in a
class declaration to prevent inheritance of the class.

It is not permitted to use the abstract modifier with a
sealed class.

Structs are implicitly sealed; therefore, they cannot be
inherited.

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we create instance of private class in c#?

504


Is c# the same as d flat?

507


How to achieve polymorphism in c#?

545


What is null character in string?

524


What is literal in c#?

473






What is yield in c#?

499


Can we have 2 main methods in c#?

485


What is the difference between parse and tryparse in c#?

494


How do you escape c#?

506


How can you achieve run time polymorphism in C#?

545


Can a class have more than 1 destructor?

516


What is difference between Enum and Struct?

554


What is the use of constructor in c# with example?

430


What is the c# equivalent of c++ catch (…), which was a catch-all statement for any possible exception? Does c# support try-catch-finally blocks?

514


What is difference between for and foreach loop in c#?

537