这是我的班级,我不希望在子班级中覆盖此方法,我该如何完成这种行为?
class A
{
public virtual void demo()
{
}
}
class B : A
{
public override void demo()
{
}
}
// when Class B be inherited in C, methods can be overridden further,
// but I don't want the method to be overridden further.
class C : B
{
}