Created
May 31, 2014 15:52
-
-
Save Fhernd/a74d1a32f10c0c65fa39 to your computer and use it in GitHub Desktop.
Demostración contravarianza para compatibilidad de parámetros de delegados en C#.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace Articulos.Cap04 | |
{ | |
internal delegate void AccionSobreString(string s); | |
internal class Aplicacion | |
{ | |
public static void Main() | |
{ | |
AccionSobreString ass = MetodoParamObject; | |
ass("Blog xCSw"); | |
} | |
static void MetodoParamObject(object paramObject) | |
{ | |
Console.WriteLine(paramObject); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment