C# Questions & Answers on Fundamental of Delegates for Freshers

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
2. To implement delegates, the necessary condition is?

a) class declaration
b) inheritance
c) run time polymorphism
d) exceptions
Answer: a
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
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
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
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
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
Answer: c
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
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
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

Related

Multiple Choice Questions 1708728646940017127

Post a Comment

emo-but-icon

item