using System;
class PruebaOcultamiento
{
public class ClaseBase
{
public int x;
public void Invocar ()
{
Console.WriteLine ("ClaseBase.Invocar");
}
}
public class ClaseDerivada : ClaseBase
{
new public void Invocar ()
{
Console.WriteLine ("ClaseDerivada.Invocar");
}
}
public static void Main ()
{
ClaseDerivada cd = new ClaseDerivada ();
ClaseBase cb = cd;
cb.Invocar();
}
}
dXNpbmcgU3lzdGVtOwpjbGFzcyBQcnVlYmFPY3VsdGFtaWVudG8KewogICAgcHVibGljIGNsYXNzIENsYXNlQmFzZQogICAgewogICAgICAgIHB1YmxpYyBpbnQgeDsKICAgICAgICAKICAgICAgICBwdWJsaWMgdm9pZCBJbnZvY2FyICgpCiAgICAgICAgewogICAgICAgICAgICBDb25zb2xlLldyaXRlTGluZSAoIkNsYXNlQmFzZS5JbnZvY2FyIik7CiAgICAgICAgfQogICAgfQogICAgCiAgICBwdWJsaWMgY2xhc3MgQ2xhc2VEZXJpdmFkYSA6IENsYXNlQmFzZQogICAgewogICAgICAgIG5ldyBwdWJsaWMgdm9pZCBJbnZvY2FyICgpCiAgICAgICAgewogICAgICAgICAgICBDb25zb2xlLldyaXRlTGluZSAoIkNsYXNlRGVyaXZhZGEuSW52b2NhciIpOwogICAgICAgIH0KICAgIH0KICAgIAogICAgcHVibGljIHN0YXRpYyB2b2lkIE1haW4gKCkKICAgIHsKICAgICAgICBDbGFzZURlcml2YWRhIGNkID0gbmV3IENsYXNlRGVyaXZhZGEgKCk7CiAgICAgICAgCiAgICAgICAgQ2xhc2VCYXNlIGNiID0gY2Q7CiAgICAgICAgCiAgICAgICAgY2IuSW52b2NhcigpOwogICAgfQp9