Dear experts,
I have this multi-cast delegate which I am having problem understand:
- delegate void M(int x, int y);
- public class Oper
- {
- public static void Add(int x, int y)
- {
- Console.WriteLine("{0} + {1} = {2}", x, y, x+y);
- }
- public static void Sub(int x, int y)
- {
- Console.WriteLine("{0} + {1} = {2}", x, y, x+y);
- }
- public class CSharpApp
- {
- static void Main()
- {
- M del = new M(Oper.Add);
- del += new M(Oper.Sub);
- del(6,4);
- del -= new M(Oper.Sub);
- del(2,8);
- }
- }

Nitin SontakkeRank #264 · 9.6K reputationPosted Nov 9, 2016, 3:35 PM EST
Nitin SontakkeRank #264 · 9.6K reputationPosted Nov 8, 2016, 11:11 PM EST
Nitin SontakkeRank #264 · 9.6K reputationPosted Nov 8, 2016, 5:16 PM EST
Tangara GRank #4,983 · 316 reputationPosted Nov 8, 2016, 9:23 PM EST
Nitin SontakkeRank #264 · 9.6K reputationPosted Nov 8, 2016, 11:08 PM EST
Tangara GRank #4,983 · 316 reputationPosted Nov 9, 2016, 3:24 PM EST
Tangara GRank #4,983 · 316 reputationPosted Nov 9, 2016, 9:23 PM EST