C# Program Example to Show Event and Delegate

C# sharp Program to show event and delegate ……

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication5
{
    public delegate void timetorise();
    class student
    {
        private event timetorise ring;
        public void wakeup()
        {
            Console.WriteLine(“Waking up…….”);
        }
        public static void Main(string[] args)
    {
        student pd= new student ();
        pd.ring= new timetorise(pd.wakeup);
        pd.ring();
        Console.ReadLine();
    }
    }
}

 

 

Add Comment