class Program {
class A {
public virtual void Print() {
Console.WriteLine("A::Print");
}
}
class B : A {
public override void Print() {
Console.WriteLine("B::Print");
}
} class C : B {
public new void Print() {
base.Print();
Console.WriteLine("C::Print");
}
}
static void Main(string[] args) {
A a = new A();
A b = new B();
A c = new C();
a.Print();
b.Print();
c.Print();
Console.ReadKey();
}
}
Login in to like
Login in to comment