using System;
class ClaseA
{
protected virtual void F()
{
Console.WriteLine ("X.F");
}
protected virtual void F2()
{
Console.WriteLine ("X.F2");
}
}
class ClaseB : ClaseA
{
sealed protected override void F()
{
Console.WriteLine ("Y.F");
}
protected override void F2()
{
Console.WriteLine ("X.F3");
}
}
class ClaseC : ClaseB
{
// Attempting to override F causes compiler error CS0239
// protected override void F() { Console.WriteLine ("C.F"); }
// Overriding F2 is allowed
protected override void F2()
{
Console.WriteLine ("Z.F2");
}
public static void Main ()
{
}
}
dXNpbmcgU3lzdGVtOwoKY2xhc3MgQ2xhc2VBCnsKICBwcm90ZWN0ZWQgdmlydHVhbCB2b2lkIEYoKQogIHsKICAgIENvbnNvbGUuV3JpdGVMaW5lICgiWC5GIik7CiAgfQogIAogIHByb3RlY3RlZCB2aXJ0dWFsIHZvaWQgRjIoKQogIHsKICAgIENvbnNvbGUuV3JpdGVMaW5lICgiWC5GMiIpOwogIH0KfQogCmNsYXNzIENsYXNlQiA6IENsYXNlQQp7CiAgICBzZWFsZWQgcHJvdGVjdGVkIG92ZXJyaWRlIHZvaWQgRigpCiAgICB7CiAgICAgICAgQ29uc29sZS5Xcml0ZUxpbmUgKCJZLkYiKTsKICAgIH0KICAgIAogICAgcHJvdGVjdGVkIG92ZXJyaWRlIHZvaWQgRjIoKQogICAgewogICAgICAgIENvbnNvbGUuV3JpdGVMaW5lICgiWC5GMyIpOwogICAgfQp9CiAKY2xhc3MgQ2xhc2VDIDogQ2xhc2VCCnsKICAgIC8vIEF0dGVtcHRpbmcgdG8gb3ZlcnJpZGUgRiBjYXVzZXMgY29tcGlsZXIgZXJyb3IgQ1MwMjM5CiAgICAvLyBwcm90ZWN0ZWQgb3ZlcnJpZGUgdm9pZCBGKCkgeyBDb25zb2xlLldyaXRlTGluZSAoIkMuRiIpOyB9CiAgICAKICAgIC8vIE92ZXJyaWRpbmcgRjIgaXMgYWxsb3dlZAogICAgcHJvdGVjdGVkIG92ZXJyaWRlIHZvaWQgRjIoKQogICAgewogICAgICAgIENvbnNvbGUuV3JpdGVMaW5lICgiWi5GMiIpOwogICAgfQogICAgCiAgICBwdWJsaWMgc3RhdGljIHZvaWQgTWFpbiAoKQogICAgewogICAgCQogICAgfQp9