Can you allow class to be inherited, but prevent the method
from being over-ridden?

Answer Posted / anubhav gupta

We can use shadowing concept.
For shadowing use New keyword in derived class method.
Through this we can prevent the method from being over
ridden.

Is This Answer Correct ?    6 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which namespaces are necessary to create a localized application?

607


What is the reason behind the invention of c#?

627


why delegate is type safe?

2599


How can you force derived classes to provide new method implementations for virtual methods?

481


What is a string in c#?

477






What is form feed and carriage return?

471


Is array passed by reference in c#?

512


How is lazy loading achieved?

493


How does inheritance work in c#?

619


What are the types of methods in c#?

457


Okay, so an int is a value type, and a class is a reference type. How can int be derived from object?

539


How does substring work in c#?

476


How do you create partial methods?

551


What is gui in c#?

540


Is string mutable in c#?

481