using System;
public class Programa
{
public class Impresora
{
public virtual void Imprimir()
{
Console.WriteLine ("Tareas básicas de impresión.");
}
}
public class Multifuncional : Impresora
{
public override void Imprimir()
{
Console.WriteLine ("Tareas especializadas de impresión.");
}
}
public static void Main ()
{
Impresora impresora = new Impresora();
impresora.Imprimir();
impresora = new Multifuncional();
impresora.Imprimir();
}
}
dXNpbmcgU3lzdGVtOwoKcHVibGljIGNsYXNzIFByb2dyYW1hCnsKICAgIHB1YmxpYyBjbGFzcyBJbXByZXNvcmEKICAgIHsKICAgICAgICBwdWJsaWMgdmlydHVhbCB2b2lkIEltcHJpbWlyKCkKICAgICAgICB7CiAgICAgICAgICAgIENvbnNvbGUuV3JpdGVMaW5lICgiVGFyZWFzIGLDoXNpY2FzIGRlIGltcHJlc2nDs24uIik7CiAgICAgICAgfQogICAgfQogICAgCiAgICBwdWJsaWMgY2xhc3MgTXVsdGlmdW5jaW9uYWwgOiBJbXByZXNvcmEKICAgIHsKICAgICAgICBwdWJsaWMgb3ZlcnJpZGUgdm9pZCBJbXByaW1pcigpCiAgICAgICAgewogICAgICAgICAgICBDb25zb2xlLldyaXRlTGluZSAoIlRhcmVhcyBlc3BlY2lhbGl6YWRhcyBkZSBpbXByZXNpw7NuLiIpOwogICAgICAgIH0KICAgIH0KICAgIAogICAgcHVibGljIHN0YXRpYyB2b2lkIE1haW4gKCkKICAgIHsKICAgICAgICBJbXByZXNvcmEgaW1wcmVzb3JhID0gbmV3IEltcHJlc29yYSgpOwogICAgICAgIGltcHJlc29yYS5JbXByaW1pcigpOwogICAgICAgIAogICAgICAgIGltcHJlc29yYSA9IG5ldyBNdWx0aWZ1bmNpb25hbCgpOwogICAgICAgIGltcHJlc29yYS5JbXByaW1pcigpOwogICAgfQp9