class A {
public virtual void M() { Console.Write("A"); }
}
class B: A {
public override void M() { Console.Write("B"); }
}
class C: B {
new public virtual void M() { Console.Write("C"); }
}
class D: C {
public override void M() { Console.Write("D"); }
static void Main() {
D d = new D();
C c = d;
B b = c;
A a = b;
d.M(); c.M(); b.M(); a.M();
}
}
我是这个概念的新手,因此将不胜感激。