What is an event in C#?

Answer

An event is a mechanism for communication between objects — allowing a class to notify other classes when something of interest occurs, following the publisher-subscriber pattern. Events are built on delegates. Declaration: public event EventHandler<ButtonClickedArgs> ButtonClicked;. Raising the event: ButtonClicked?.Invoke(this, new ButtonClickedArgs()); (null-conditional — safe if no subscribers). Subscribing: button.ButtonClicked += HandleClick;. Unsubscribing: button.ButtonClicked -= HandleClick;. Key difference from delegate: events can only be invoked from the class that declares them (not from outside) — enforcing the publisher pattern. EventHandler<TEventArgs> is the standard delegate type for events: (object sender, TEventArgs e). Always unsubscribe from events to prevent memory leaks (subscriber holds reference to publisher).