1. In C#, which keyword is used to remove an event handler from an event? A. -= B. += C. /= D. *= Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
2. What is the purpose of the GetInvocationList() method associated with delegates in C#? A. Removes a delegate from the current delegate B. Adds a new delegate to the current delegate C. Invokes all the delegates bound to the current delegate D. Retrieves an array of delegates bound to the current delegate Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
3. What is a callback function in the context of delegates and events in C#? A. A function that is called when an event is raised B. A function that is called to subscribe to an event C. A function that is called to unsubscribe from an event D. A function that is called to handle an event Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
4. In C#, which delegate type is used to represent methods that do not return a value and do not take any parameters? A. Func B. Predicate C. Action D. EventHandler Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
5. What is the purpose of the Invoke() method associated with delegates in C#? A. Adds a new delegate to the event B. Invokes the delegate's method C. Retrieves the delegate's method D. None of the above Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B No explanation is given for this question Let's Discuss on Board
6. In C#, which keyword is used to declare an event that can be raised only by the declaring class or a derived class? A. protected B. internal C. private D. public Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
7. What is the purpose of the Action delegate in C#? A. Represents a delegate that encapsulates a method that takes no parameters and does not return a value B. Represents a delegate that encapsulates a method that takes no parameters and returns a value C. Represents a delegate that can encapsulate a method with a single parameter and does not return a value D. Represents a delegate that encapsulates a method that has two parameters and returns a value Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
8. In C#, which class is used to encapsulate methods in a multicast delegate? A. MulticastDelegate B. Action C. Func D. Delegate Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
9. What is the difference between delegates and interfaces in C#? A. Delegates define a contract for classes to implement methods, whereas interfaces provide a way to reference methods B. Delegates can encapsulate methods with different signatures, whereas interfaces define methods with specific signatures C. Delegates cannot be used with events, whereas interfaces can D. Delegates provide a way to reference methods, whereas interfaces define a contract for classes to implement methods Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
10. What is an anonymous method in C#? A. A method without a name defined using the delegate keyword B. A method that can be accessed from anywhere in the code C. A method defined using the event keyword D. A method defined within another method Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board