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

Can bool be null c#?

508


What is datatable in c#?

502


How do you declare an arraylist?

504


What is parameters in c#?

510


What are the principles of delegation?

496






Can abstract class be instantiated c#?

528


Explain the process of polymorphism with an example?

489


What is the different types of private assembly and shared assembly?

509


Can we maintain state in webservice?

510


What is the default scope of a class in c#?

491


What is type cast in C#?

571


Why we use get set in c#?

514


Can struct be static in c#?

522


what is .NET framework architecture ??

1571


What is clr namespace?

500