This section of our 1000+ C# MCQs focuses in detail on delegates in C# Programming Language.
1. The ‘ref’ keyword can be used with which among the following?
a) Static function/subroutine
b) Static data
c) Instance function/subroutine
d) All of the mentioned
View Answer
Explanation: None.
2. To implement delegates, the necessary condition is?
a) class declaration
b) inheritance
c) runtime polymorphism
d) exceptions
View Answer
Explanation: None.
3. Suppose a Generic class called as SortObjects is to be made capable of sorting objects of any type(integer, single, byte etc). Then, which of the following programming constructs is able to implement the comparison function?
a) interface
b) encapsulation
c) delegate
d) attribute
View Answer
Explanation: None.
4. To generate a simple notification for an object in runtime, the programming construct to be used for implementing this idea?
a) namespace
b) interface
c) delegate
d) attribute
View Answer
Explanation: None.
5. Choose the incorrect statement among the following about the delegate?
a) delegates are of reference types
b) delegates are object oriented
c) delegates are type safe
d) none of the mentioned
View Answer
Explanation: None.
6. Which among the following is the correct statement about delegate declaration?
delegate void del(int i);
a) on declaring the delegate, a class called del is created
b) the del class is derived from the MulticastDelegate class
c) the del class will contain a one argument constructor and an invoke() method
d) all of the mentioned
View Answer
Explanation: None.
7. Which of the following is an incorrect statement about delegate?
a) a single delegate can invoke more than one method
b) delegates could be shared
c) delegates are type safe wrappers for function pointers
d) delegate is a value type
View Answer
Explanation: In C#, a delegate is a reference type instead of a value type as it stores a reference to a data/method.
8. Which among the following differentiates a delegate in C#.NET from a conventional function pointer in other languages?
a) delegates in C#.NET represent a new type in the Common Type System
b) delegates allows static as well as instance methods to be invoked
c) delegates are type safe and secure
d) none of the mentioned
View Answer
Explanation: None.
9. Choose the incorrect statement about delegates?
a) delegates are not type safe
b) delegates can be used to implement callback notification
c) delegate is a user defined type
d) delegates permits execution of a method in an asynchronous manner
View Answer
Explanation: None.
10. Which of the following statements is correct about a delegate?
a) inheritance is a prerequisite for using delegates
b) delegates are not type safe
c) delegates provides wrappers for function pointers
d) none of the mentioned
View Answer
Explanation: None.
More MCQs on Delegates in C#:
Sanfoundry Global Education & Learning Series – C# Programming Language.
To practice all areas of C# language, here is complete set of 1000+ Multiple Choice Questions and Answers.
- Practice Computer Science MCQs
- Apply for C# Internship
- Check MCA Books
- Practice MCA MCQs
- Check Computer Science Books