疑惑的virtual method
class A
{
public virtual void fun(int i)
{
Console.WriteLine(i);
}
public void fun2(A a)
{
a.fun(1);
fun(5);
}
}
class B:A
{
public override void fun(int i)
{
base.fun(i+1);
}
}
class Program
{
static void Main(string[] args)
{
A a = new A();
B b = new B();
a.fun2(b);
b.fun2(a);
}
}