suman roy

suman roy

  • NA
  • 21
  • 721

How to send different parameters in multicast delegate

Jun 11 2018 1:20 PM
  1. delegate void Print(string str);    
  2. class Program    
  3. {    
  4.    static void Main(string[] args)    
  5.    {    
  6.       Print dele = method1;    
  7.       dele += method2;    
  8.       dele += method3;    
  9.       dele("1");    
  10.       Console.ReadKey();    
  11.    }    
  12.    public static void method1(string s)    
  13.    {    
  14.       Console.WriteLine($"Hello{s}");    
  15.    }    
  16.        
  17.    private static void method1(string s)    
  18.    {    
  19.       Console.WriteLine($"Hello{s}");    
  20.    }    
  21.    protected static void method1(string s)    
  22.    {    
  23.       Console.WriteLine($"Hello{s}");    
  24.    }    
  25. }

Answers (1)