using System;
public class A
{
public virtual void f1()
{
Console.WriteLine("A.f1() _ base");
}
}
public class B: A
{
public override void f1()
{
Console.WriteLine("B.f1()");
}
public void f1(string messaggio)
{
Console.WriteLine($"B.f1(<{messaggio}>)");
base.f1();
}
}
public class Test
{
public static void Main()
{
// your code goes here
A a,n;
B b;
a=new A();
b=new B();
n=new B();
a.f1();
b.f1();
b.f1("Nuovo");
n.f1();
}
}
dXNpbmcgU3lzdGVtOwoKcHVibGljIGNsYXNzIEEKewoJcHVibGljIHZpcnR1YWwgdm9pZCBmMSgpCgl7CgkJQ29uc29sZS5Xcml0ZUxpbmUoIkEuZjEoKSBfIGJhc2UiKTsKCX0KfQoKcHVibGljIGNsYXNzIEI6IEEKewoJcHVibGljIG92ZXJyaWRlIHZvaWQgZjEoKQoJewoJCUNvbnNvbGUuV3JpdGVMaW5lKCJCLmYxKCkiKTsKCX0KCQoJcHVibGljIHZvaWQgZjEoc3RyaW5nIG1lc3NhZ2dpbykKCXsKCQlDb25zb2xlLldyaXRlTGluZSgkIkIuZjEoPHttZXNzYWdnaW99PikiKTsKCQliYXNlLmYxKCk7Cgl9Cn0KCnB1YmxpYyBjbGFzcyBUZXN0CnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBNYWluKCkKCXsKCQkvLyB5b3VyIGNvZGUgZ29lcyBoZXJlCgkJQSBhLG47CgkJQiBiOwoJCWE9bmV3IEEoKTsKCQliPW5ldyBCKCk7CgkJbj1uZXcgQigpOwoJCWEuZjEoKTsKCQliLmYxKCk7CgkJYi5mMSgiTnVvdm8iKTsKCQluLmYxKCk7Cgl9Cn0=