C# Programming - Delegates

Why should I learn to solve C# Programming questions and answers section on "Delegates"?

Learn and practise solving C# Programming questions and answers section on "Delegates" to enhance your skills so that you can clear interviews, competitive examinations, and various entrance tests (CAT, GATE, GRE, MAT, bank exams, railway exams, etc.) with full confidence.

Where can I get the C# Programming questions and answers section on "Delegates"?

IndiaBIX provides you with numerous C# Programming questions and answers based on "Delegates" along with fully solved examples and detailed explanations that will be easy to understand.

Where can I get the C# Programming section on "Delegates" MCQ-type interview questions and answers (objective type, multiple choice)?

Here you can find multiple-choice C# Programming questions and answers based on "Delegates" for your placement interviews and competitive exams. Objective-type and true-or-false-type questions are given too.

How do I download the C# Programming questions and answers section on "Delegates" in PDF format?

You can download the C# Programming quiz questions and answers section on "Delegates" as PDF files or eBooks.

How do I solve C# Programming quiz problems based on "Delegates"?

You can easily solve C# Programming quiz problems based on "Delegates" by practising the given exercises, including shortcuts and tricks.

Exercise : Delegates - General Questions
  • Delegates - General Questions
1.
Which of the following statements is incorrect about delegate?
Delegates are reference types.
Delegates are object oriented.
Delegates are type-safe.
Delegates serve the same purpose as function pointers in C and pointers to member function operators in C++.
Only one method can be called using a delegate.
Answer: Option
Explanation:
No answer description is available. Let's discuss.

2.
In which of the following areas are delegates commonly used?
  1. Remoting
  2. Serialization
  3. File Input/Output
  4. Multithreading
  5. Event handling
1 and 2 only
1 and 5 only
1, 2 and 3 only
4 and 5 only
All of the above
Answer: Option
Explanation:
No answer description is available. Let's discuss.

3.
Which of the following is the necessary condition for implementing delegates?
Class declaration
Inheritance
Run-time Polymorphism
Exceptions
Compile-time Polymorphism
Answer: Option
Explanation:
No answer description is available. Let's discuss.

4.
Which of the following statements are correct about the delegate declaration given below?
    delegate void del(int i);
  1. On declaring the delegate a class called del will get created.
  2. The signature of del need not be same as the signature of the method that we intend to call using it.
  3. The del class will be derived from the MulticastDelegate class.
  4. The method that can be called using del should not be a static method.
  5. The del class will contain a one-argument constructor and an lnvoke() method.
1, 2 and 3 only
1, 3 and 5 only
2 and 4 only
4 only
All of the above
Answer: Option
Explanation:
No answer description is available. Let's discuss.

5.
Which of the following is the correct way to call the function MyFun() of the Sample class given below?
class Sample
{
    public int MyFun(int i)
    {
        Console.WriteLine("Welcome to IndiaBIX.com !" );
        return 0;
    }
}
delegate void del(int i);
Sample s = new Sample();
deld = new del(ref s.MyFun);
d(10);
delegate int del(int i);
Sample s = new Sample(.);
del = new delegate(ref MyFun);
del(10);
Sample s = new Sample();
delegate void del = new delegate(ref MyFun);
del(10);
delegate int del(int i);
del d;
Sample s = new Sample();
d = new del(ref s.MyFun);
d(10);
Answer: Option
Explanation:
No answer description is available. Let's discuss.