0
using System;
namespace multicastdeligate
{
    delegate void Del1(int s);
    class TestClass
    {
        static void number(int s)
        {
            System.Console.WriteLine("  Hello, {0}!", s);
        }
        static void Main()
        {
            Del1 x, y;
            x = number;
            y = number;
            System.Console.WriteLine("Invoking delegate x:");
            x(5);
            System.Console.WriteLine("Invoking delegate y:");
            y(5);
            System.Console.WriteLine("Invoking through method call:");
            number(5);
        }
    }
}

I have called through normal function calling and delegates.

what is the need to call function using delegate?

Mohit S
  • 13,723
  • 6
  • 34
  • 69
Joyner
  • 312
  • 1
  • 2
  • 11

0 Answers0