Answer Posted / techy_unknown
Hi,
I think the question itself is illogical.
The term "overriding" is ONLY and ONLY associated with
methods/properties not to the class.
So, if the question is put a like, "How to prevent methods
not to be overriden?" then the answer is: "Make them non-
virtual."
And if the question is put a like, "How to prevent the
inheritance for a specific class?" then the answer
is, "Make the calss sealed."
I really hope that the reply makes sense here.
Is This Answer Correct ? | 38 Yes | 1 No |
Post New Answer View All Answers
Can a struct inherit from another struct or class in c#?
Is everything an object c#?
What does ienumerable mean?
What is an abstract class c#?
Why do we need constructors?
Explain attributes in c#?
Will the following code compile?
Is c# a technology?
What is the correct way of declaring an xml namespace?
What is serialization in .net?
What are delegates?
What is xaml in c#?
What is difference between private and protected in c#?
Can you inherit from multiple classes in c#?
Why static constructor is parameterless in c#?