- delegate void Print(string str);
- class Program
- {
- static void Main(string[] args)
- {
- Print dele = method1;
- dele += method2;
- dele += method3;
- dele("1");
- Console.ReadKey();
- }
- public static void method1(string s)
- {
- Console.WriteLine($"Hello{s}");
- }
- private static void method1(string s)
- {
- Console.WriteLine($"Hello{s}");
- }
- protected static void method1(string s)
- {
- Console.WriteLine($"Hello{s}");
- }
- }
Loading

Aniket RanaRank #1,691 · 902 reputationPosted Jun 11, 2018, 8:29 PM EDT