Skip to content

Instantly share code, notes, and snippets.

@Fhernd
Created May 31, 2014 16:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Fhernd/d42da3ed9c25b77bf205 to your computer and use it in GitHub Desktop.
Save Fhernd/d42da3ed9c25b77bf205 to your computer and use it in GitHub Desktop.
Demostración concepto de covarianza en delegados en C#.
using System;
namespace Articulos.Cap04
{
internal delegate object AccionObject();
internal class Aplicacion
{
public static void Main()
{
// Declaración instancia de `AccionObject`:
AccionObject del = new AccionObject(ObtenerString);
object resultado = del();
Console.WriteLine("Contenido de `resultado`: {0}", resultado);
}
public static string ObtenerString()
{
return "Blog xCSw";
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment