Delegates Questions and Answers
Practice ModeShowing 10 of 32 questions
Q11
Suppose a Generic class called SortObjects is to be made capable of sorting objects of any type (Integer, Single, Byte etc.). Which of the following programming constructs should be used to implement the comparision function?
Answer: Option D
Q12
With which of the following can the ref keyword be used?
Static data
Instance data
Static function/subroutine
Instance function/subroutine
Answer: Option B
Q13
What is a delegate in C#?
Answer: Option B
Explanation: A delegate is a type-safe function pointer that defines a method signature.
Q14
Which keyword is used to define a delegate in C#?
Answer: Option B
Explanation: The delegate keyword is used to define a delegate type in C#.
Q15
What is the base class for all delegates in C#?
Answer: Option B
Explanation: System.MulticastDelegate is the base class for all delegate types in C#.
Q16
Which of the following is true about delegates?
Answer: Option C
Explanation: Delegates are type-safe and can point to multiple methods.
Q17
What is multicast delegate in C#?
Answer: Option B
Explanation: A delegate that can hold references to multiple methods and invoke them in sequence.
Q18
How do you combine multiple delegates into one?
Answer: Option B
Explanation: The + operator is used to combine delegates in C#.
Q19
What happens when a multicast delegate is invoked?
Answer: Option C
Explanation: All methods referenced by the delegate are called in the order they were added.
Q20
Which of these is NOT a built-in delegate in C#?
Answer: Option C
Explanation: FuncDelegate is not a built-in delegate type in C#.