Interview answers verified by specialists.

Find interview questions and answers on this website:

See right interview answers on 30 common job interview questions

Describe Event in .Net.

Ans.It is an important feature of C# that is based upon delegate. An Event is a message sent by an object such as control (Button, Checkbox, Radio button,etc.) or other part of the user interface, that the program responds to by executing code. It is an automatic notification that some action has occurred.
Events are members of a class and are declared using the eventkeyword. The general prototype of an event declaration 

event event-delegate event-name;


using System;
namespace Test
// Declare a delegate type for an event.
delegate void MyEventHandler();
// Declare a class that contains an event.
class MyEvent
public event MyEventHandler SomeEvent;
// This is called to fire the event.
public void OnSomeEvent()
if (SomeEvent != null)
class EventDemo
// An event handler.
static void MyHandler()
Console.WriteLine("Event occurred");
static void Main()
MyEvent evt = new MyEvent();
// Add MyHandler() to the event list.
evt.SomeEvent += MyHandler;
// Fire the event.

Do you know that?

1 in 4 university students work online Next


Fast Payments
Payoneer sing up to get free