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 does namespace mean?
Why do we use struct in c#?
what is the purpose of using statement in c#
What language is arduino?
What is streamreader/streamwriter class?
Differentiate between method overriding from method overloading with its functionality?
Is a valid int value?
what is the scope of anonymous type ?
Which property do we set on a Combo Box to display data on it prior to setting the DataSource ?
What is the boxing and unboxing in c#?
List the differences between method overriding and method overloading?
How do you declare a method in c#?