Categories

Oct 18, 2019 in C Sharp (C#)
Q: Define Multicast Delegate in C#?

1 Answer

Oct 18, 2019
A delegate with multiple handlers are called as multicast delegate. The example to demonstrate the same is given below

public delegate void CalculateMyNumbers(int x, int y);

int x = 6;

int y = 7;

CalculateMyNumbers addMyNumbers = new CalculateMyNumbers(FuncForAddingNumbers);

CalculateMyNumbers multiplyMyNumbers = new CalculateMyNumbers(FuncForMultiplyingNumbers);

CalculateMyNumbers multiCast = (CalculateMyNumbers)Delegate.Combine (addMyNumbers, multiplyMyNumbers);

multiCast.Invoke(a,b);
Click here to read more about C Sharp
Click here to read more about Insurance

Related questions

Madanswer
Mar 5 in C Sharp (C#)
Jun 16 in C Sharp (C#)
Jun 16 in C Sharp (C#)
...