using System;
public delegate string PrintDelegate(string name); //1. Create the Delegate
public class Program
{
public static void Main()
PrintDelegate printDel = delegate(string name)
return "Hello " + name + ". Good Morning";
}; //2. Create instance of Delegate using delegate keyword and adding the method bodu
string result = printDel("John"); //3. Invoke the Delegate
Console.WriteLine(result); //4. Print the result
}
/*public static string Print(string name) //1. Create the method - No longer needed
}*/