Can you allow a class to be inherited but prevent a method f
Can you allow a class to be inherited, but prevent a method from being overridden in C#?
Solution
yes,I can allow a class to be inherited in the following cases
I can expalin with th following example by writing small code
Example:
class A
{
protected virtual void show()
{
//Statements
}
}
class B : A
{
sealed protected override void shoe()
{
//Statements
}
}
