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


Please Help Members By Posting Answers For Below Questions

What do you mean by sealed classes and static classes?

722


Why do we use constructors in c#?

789


What is jagged array in c#?

744


What is iformatprovider in c#?

681


Can you mark static constructor with access modifiers?

733


write a program to find the biggest palindrome in the given string

738


Why interface is required?

626


What is the difference between static class and abstract class in c#?

670


Is functional interface runnable?

676


Which technology is best for desktop application?

624


What language is c# similar to?

699


Why are strings immutable c#?

643


What is dataset c#?

703


What's your approach to fetch static data in your windows form application?

724


What do you mean by generic class in c#?

671