- 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 RanaPosted Jun 12, 2018, 12:29 AM