is it possible to inherit a class but methods declared in
the class should not be inheritable i possible how?
Answer Posted / vishal
That's Correct.
Using private keyword in the method signature is a way of
preventing inheritance of that method in child class.
Please note that using "sealed" keyword in method signature
only prevents overriding of the method in child class, but
the method is still inheritable in the child class.
| Is This Answer Correct ? | 8 Yes | 0 No |
Post New Answer View All Answers
When can a derived class override a base class member?
Can you explicitly call a destructor?
What is a hash table in c#?
Why abstract class can not be instantiated?
Define a strong name in .net?
What are extender provider components?
What are verbatim strings in c#?
What is the use of console application in c#?
What is an iqueryable in c#?
What is concrete class in c# with example?
When Should You Call The Garbage Collector In .net?
If I want to override a method one of class A and in class b then how do you declare?
What is an extension method in c#?
Why are strings immutable in c#?
Why References are stored on heap and variables on stack?