In the following C# code, which of the following statements are perfectly valid?
public class MyContainer<T> where T: IComparable
{
/* insert code here */
}
public class MyContainer<T> where T: IComparable
{
/* insert code here */
}A. Class MyConatiner requires that its type argument must implement Icomparable interface
B. There are multiple constraints on type argument to MyContainer class
C. Type argument of class MyContainer should be Icomparable
D. None of the mentioned
Answer: Option A
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
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
A. Func
B. Predicate
C. Action
D. EventHandler

Join The Discussion