Delegates - General Questions Online Exam Quiz

Delegates - General Questions GK Quiz. Question and Answers related to Delegates - General Questions. MCQ (Multiple Choice Questions with answers about Delegates - General Questions

In which of the following areas are delegates commonly used?

Options

A : 1 and 2 only

B : 1 and 5 only

C : 1, 2 and 3 only

D : 4 and 5 only

View Answer

Which of the following is the necessary condition for implementing delegates?

Options

A : Class declaration

B : Inheritance

C : Run-time Polymorphism

D : Exceptions

View Answer

Which of the following statements are correct about the delegate declaration given below?

Options

A : 1, 2 and 3 only

B : 1, 3 and 5 only

C : 2 and 4 only

D : 4 only

View Answer

Which of the following is the correct way to call the function MyFun() of the Sample class given below?

Options

A : delegate void del( int i); Sample s = new Sample(); deld = new del( ref s.MyFun); d( 10 );

B : delegate int del( int i); Sample s = new Sample(.); del = new delegate ( ref MyFun); del( 10 );

C : Sample s = new Sample(); delegate void del = new delegate ( ref MyFun); del( 10 );

D : delegate int del( int i); del d; Sample s = new Sample(); d = new del( ref s.MyFun); d( 10 );

View Answer

Which of the following is the correct way to call subroutine MyFun() of the Sample class given below?

Options

A : delegate void del( int i); Sample s = new Sample(); del d = new del( ref s.MyFun); d( 10 , 1.1 f);

B : delegate void del( int i, Single j); del d; Sample s = new Sample(); d = new del( ref s.MyFun); d( 10 , 1.1 f);

C : Sample s = new Sample(); delegate void d = new del( ref MyFun); d( 10 , 1.1 f);

D : delegate void del( int i, Single]); Sample s = new Sample(); del = new delegate ( ref MyFun); del( 10 , 1.1 f);

View Answer

Which of the following statements are correct about a delegate?

Options

A : 1 and 2 only

B : 1, 2 and 3 only

C : 2, 3 and 4 only

D : All of the above

View Answer

Which of the following statements are correct about delegates?

Options

A : 1 and 2 only

B : 1, 2 and 3 only

C : 2, 4 and 5 only

D : 4 and 5 only

View Answer

Which of the following statements are correct about delegates?

Options

A : Delegates cannot be used to call a static method of a class.

B : Delegates cannot be used to call procedures that receive variable number of arguments.

C : If signatures of two methods are same they can be called through the same delegate object.

D : Delegates cannot be used to call an instance function. Delegates cannot be used to call an instance subroutine.

View Answer

Which of the following are the correct ways to declare a delegate for calling the function func() defined in the sample class given below?

Options

A : delegate d(int i, Single j);

B : delegate void d(int, Single);

C : delegate int d(int i, Single j);

D : delegate void (int i, Single j);

View Answer

Suppose on pushing a button an object is to be notified, but it is not known until runtime which object should be notified. Which of the following programming constructs should be used to implement this idea?

Options

A : Attribute

B : Delegate

C : Namespace

D : Interface

View Answer

Attributes - General Questions more Online Exam Quiz

Attributes - General Questions

Classes and Objects - General Questions

Collection Classes - General Questions

Constructors - General Questions

Datatypes - General Questions

.NET Framework - General Questions

Enumerations - General Questions

Exception Handling - General Questions

Functions and Subroutines - General Questions