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
Why do we use lambda expression in c#?
How to declare a property in a class?
Which of these string definitions will prevent escaping on backslashes in c#?
Why would you use a class property in c#?
What is the use of console readkey in c#?
What are instance fields in c#?
Can a class be protected in c#?
What is the symbol used for in c#?
Is hashset ordered c#?
What is c# most used for?
What is the difference between finalize() and dispose()?
What are sessions in c#?
What is use of a HashTable in .NET?
What is the object class in c#?
What is difference between ienumerable and enumerable in c#?