delegate_param1.htm
 
 

using System;
using System.Collections;
//csc delegate_param.cs
namespace ConsoleApplication1
{
delegate void MyDelegate(int i);
class MainClass
{
public static void Main(string[] args)
{
Console.WriteLine("Hello World!");
TakesADelegate(new MyDelegate(DelegateFunction));
Console.ReadLine();
}
public static void TakesADelegate(MyDelegate SomeFunction)
{
Console.WriteLine("Delegating .platform.");
SomeFunction(21);

}
public static void DelegateFunction(int i)
{
Console.WriteLine("passing a number "+ i);
}
}

}