Delegates & events · interview question
What does declaring a delegate member with the event keyword add over a public delegate field?
Multiple choiceMedium
Answer and explanation
Correct answer
A. Outside code can only subscribe (+=) or unsubscribe (-=). Only the declaring class can invoke or replace it.
Why
event is an encapsulation feature: it stops other classes from wiping the invocation list (= null) or raising the event themselves.
Test yourself on Delegates & events
A free test with instant, explained results. No account needed.