Can you allow class to be inherited, but prevent the method
from being over-ridden?
Answers were Sorted based on User's Feedback
Answer / umesh
Yes, just leave the class public and make the method sealed.
Is This Answer Correct ? | 17 Yes | 1 No |
Answer / anubhav gupta
We can use shadowing concept.
For shadowing use New keyword in derived class method.
Through this we can prevent the method from being over
ridden.
Is This Answer Correct ? | 6 Yes | 3 No |
What is ildasm.exe used for?
What is cookies in c# asp net?
Whats the use of string builder?
What is the syntax for calling an overloaded constructor within a constructor (this() and constructorname() does not compile)?
Can properties be private in c#?
How does bitwise xor work?
What are methods in C#?
How do I trim a space in c#?
What are instance fields in c#?
What is verbatim string?
Define multicast delegate? How it be used?
In .Net, what is an assembly? Also explain the type of assembly.