我的情况是这样的:
public class InheritedClass : BaseClass
{
public override void SomeMethod()
{
AnotherMethod();
}
public override void AnotherMethod()
{
}
}
public class BaseClass
{
public virtual void SomeMethod()
{ }
public virtual void AnotherMethod()
{ }
}
那么当我调用时调用了哪个方法InheritedClassInstance.SomeMethod
?它是调用InheritedClassInstance.AnotherMethod
还是 BaseClass 的AnotherMethod
?