struct A {
public virtual void foo() {
Console.WriteLine("A");
}
}
struct B : A {
public virtual override void foo() {
Console.WriteLine("B");
}
}
class Program
{
static void Main(string[] args) {
A v = new B();
v.foo();
}
}
Login in to like
Login in to comment