Created
February 6, 2019 11:03
-
-
Save maacpiash/9ecda6c8fda900a37c52f5605f57c939 to your computer and use it in GitHub Desktop.
Testing Delegates
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 DelegateTesting | |
{ | |
class Program | |
{ | |
public static void Main(string[] args) | |
{ | |
SaySomething s = SayHello; | |
Print(s); | |
} | |
public delegate string SaySomething(string inp); | |
public static string SayHello(string name) => "Hello, " + name + "!"; | |
public static void Print(SaySomething method) => Console.WriteLine(method); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment