Delegates And Events In C Sharp - Study Mode
[#6] In C#, which keyword is used to declare an event that can be raised only by the declaring class or a derived class?
Correct Answer
(C) private
[#7] What is the purpose of the Action delegate in C#?
Correct Answer
(C) Represents a delegate that can encapsulate a method with a single parameter and does not return a value
[#8] In C#, which class is used to encapsulate methods in a multicast delegate?
Correct Answer
(D) Delegate
[#9] What is the difference between delegates and interfaces in C#?
Correct Answer
(D) Delegates provide a way to reference methods, whereas interfaces define a contract for classes to implement methods
[#10] What is an anonymous method in C#?
Correct Answer
(A) A method without a name defined using the delegate keyword