What are Sealed Classes in C#?

Answers were Sorted based on User's Feedback



What are Sealed Classes in C#?..

Answer / aseem

If it restricts inheritance then why dont we create a
normal class. why do we require this seamled class to
inherit? can any one show with example?

Is This Answer Correct ?    3 Yes 3 No

What are Sealed Classes in C#?..

Answer / rishu

Sealed classes are used to restrict the inheritance feature of object oriented programming. Once a class is defined as sealed class, this class cannot be inherited.
In C#, the sealed modifier is used to define a class as sealed. In Visual Basic .NET, NotInheritable keyword serves the purpose of sealed. If a class is derived from a sealed class, compiler throws an error.

If you have ever noticed, structs are sealed. You cannot derive a class from a struct.

Is This Answer Correct ?    0 Yes 0 No

What are Sealed Classes in C#?..

Answer / haja

Hello Guys this is Haja,

I think the question is "What are sealed classes in C#?"
not "WHAT IS SEALED CLASS IN C#?"

The answer is "Every attribute classes are sealed class like [WebMethod], [STAThread], [Serializable] and like these attribute classes...

Is This Answer Correct ?    0 Yes 0 No

What are Sealed Classes in C#?..

Answer / atul dhivar

sealedclasses cannot be extended,but they can inherit from
other classes

Is This Answer Correct ?    2 Yes 3 No

What are Sealed Classes in C#?..

Answer / alex

sealed class used for a security purpose without using sealed class , the class must be inherited,

Is This Answer Correct ?    0 Yes 2 No

What are Sealed Classes in C#?..

Answer / sanjay

sealed classes can only be used as a base classes,they cant
be inherited.

Is This Answer Correct ?    23 Yes 27 No

What are Sealed Classes in C#?..

Answer / susheel kumar

sealed classes used only base class do not used derived class

Is This Answer Correct ?    20 Yes 32 No

Post New Answer

More C Sharp Interview Questions

State two different types of access modifiers.

0 Answers  


Explain the difference between object type and dynamic type variables in c#?

0 Answers  


What is the namespcae generally given to the webpage of the .NET Framework ?

0 Answers   Siebel,


How can you overload a method?

6 Answers  


What is datetime minvalue in c#?

0 Answers  






Is string primitive?

0 Answers  


What is remote data?

0 Answers  


What does immutable mean in c#?

0 Answers  


Why linq is having select clause at the end?

0 Answers  


How do you name a variable in c#?

0 Answers  


If a class derives from another class, will the derived class automatically contain all the public, protected, and internal members of the base class?

0 Answers  


Is hashset ordered c#?

0 Answers  


Categories