Can you prevent your class from being inherited and becoming
a base class for some other classes?
Answers were Sorted based on User's Feedback
Answer / umesh
Yes, that?s what keyword sealed in the class definition is
for. The developer trying to derive from your class will get
a message: cannot inherit from Sealed class
WhateverBaseClassName. It?s the same concept as final class
in Java.
Is This Answer Correct ? | 12 Yes | 2 No |
Answer / neerajtyagi
You can prevent your class being derived using sealed
keyword.
But you can't use that class as base class once you make
that sealed.
Sealed and Derived both are opposite.
Is This Answer Correct ? | 8 Yes | 0 No |
What are the differences between system.string and system.text.stringbuilder classes?
What is the difference between interface and abstract class in c#?
What language is c# similar to?
Is string a class in c#?
Can delegates be used as callbacks?
What is console read in c#?
What is integer c#?
What do u mean by thread safe?
What is the use of functional interface?
What are the 3 different types of arrays?
When a switch is said to be congested?
What does xpath return?