Skip to content

Instantly share code, notes, and snippets.

@maacpiash
Created February 6, 2019 11:03
Show Gist options
  • Save maacpiash/9ecda6c8fda900a37c52f5605f57c939 to your computer and use it in GitHub Desktop.
Save maacpiash/9ecda6c8fda900a37c52f5605f57c939 to your computer and use it in GitHub Desktop.
Testing Delegates
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