250+ TOP MCQs on Fundamental of Delegates and Answers

C# MCQs 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

Answer: a
Clarification: None.

2. To implement delegates, the necessary condition is?
a) class declaration
b) inheritance
c) runtime polymorphism
d) exceptions

Answer: a
Clarification: 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

Answer: c
Clarification: 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

Answer: c
Clarification: 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

Answer: d
Clarification: 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

Answer: d
Clarification: 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

  250+ TOP MCQs on String Formatting – 2 and Answers

Answer: c
Clarification: None.

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

Answer: d
Clarification: 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

Answer: a
Clarification: 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

Answer: c
Clarification: None.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top