C# Programming - Delegates
Exercise : Delegates - General Questions
- Delegates - General Questions
6.
Which of the following is the correct way to call subroutine MyFun() of the Sample class given below?
class Sample
{
public void MyFun(int i, Single j)
{
Console.WriteLine("Welcome to IndiaBIX !");
}
}
7.
Which of the following statements are correct about a delegate?
- Inheritance is a prerequisite for using delegates.
- Delegates are type-safe.
- Delegates provide wrappers for function pointers.
- The declaration of a delegate must match the signature of the method that we intend to call using it.
- Functions called using delegates are always late-bound.
8.
Which of the following statements are correct about delegates?
- Delegates are not type-safe.
- Delegate is a user-defined type.
- Only one method can be bound with one delegate object.
- Delegates can be used to implement callback notification.
- Delegates permit execution of a method on a secondary thread in an asynchronous manner.
9.
Which of the following statements are correct about delegates?
10.
Which of the following are the correct ways to declare a delegate for calling the function func() defined in the sample class given below?
class Sample
{
public int func(int i, Single j)
{
/* Add code here. */
}
}
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers