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 are extender provider components?

554


What is the difference between internal and protected in c#?

532


Which is faster hashtable or dictionary?

582


What is a console file?

574


Explain the types of errors in c#?

561






What is the difference between class and namespace?

572


Is Facebook a desktop application?

562


What is interpolation in programming?

577


What is generic delegate in c#?

531


What is the use of GC.KeepAlive Method?

763


What is the difference between and xml documentation tag?

619


What is visual c# net?

555


Constructor to an arbitrary base constructor?

647


Can we use "this" command within a static method?

639


What is the difference between method parameters and method arguments. Give an example?

584