delegate string MethodDelegate(string z);
static string sentence = "Mozart is ";
public static string Method1(string x)
sentence = "Mozart is " + x;
public static string Method2(string y)
sentence = "Salieri is " + y;
public static string getSentence()
static void Main(string[] args)
MethodDelegate obj1 = new MethodDelegate(Method1);
MethodDelegate obj2 = new MethodDelegate(Method2);
Console.WriteLine(">>> " + getSentence());
Console.WriteLine(">>> " + getSentence());