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
What Happens In Memory When You Box And Unbox A Value-type?
What are boxing and unboxing?
Why delegate is used in c#?
Is datetime a value type in c#?
What is the main method in c#?
What is the use of ienumerable?
Why do we use struct in c#?
What is the use of console?
What is the difference between an implicit conversion and an explicit conversion?
What is the difference between a class and an object c#?
What is asynchronous one-way calls?
Explain the difference between object type and dynamic type variables in c#?
Why do we need indexer in c#?
What is the benefit of interface in c#?
can you declare an override method to be static if the original method is not static?