Delegates

Delegates

University

20 Qs

quiz-placeholder

Similar activities

Reading and Note-Taking Skills

Reading and Note-Taking Skills

University

20 Qs

Construction Delivery Methods Quiz

Construction Delivery Methods Quiz

University

22 Qs

REVISION 2 : TOPIC 7, 8 & 9

REVISION 2 : TOPIC 7, 8 & 9

1st Grade - University

20 Qs

Social classes for children

Social classes for children

University

15 Qs

POL1 CH12

POL1 CH12

12th Grade - University

20 Qs

Kuis Jaringan Komputer UTS T.A 23/24

Kuis Jaringan Komputer UTS T.A 23/24

University

20 Qs

Introduction to Research

Introduction to Research

University

18 Qs

REVISION 3 : TOPIC 8 [ACCOUNTING FOR INVENTORIES]

REVISION 3 : TOPIC 8 [ACCOUNTING FOR INVENTORIES]

1st Grade - University

20 Qs

Delegates

Delegates

Assessment

Quiz

Education

University

Hard

Created by

Innocent Manganyi

Used 1+ times

FREE Resource

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

What is a delegate in C#?

A class that encapsulates a method signature

A pointer to a function

A type-safe function pointer

A reserved keyword for asynchronous programming

Answer explanation

A delegate in C# is a type-safe function pointer that can reference methods with a particular signature.

2.

MULTIPLE CHOICE QUESTION

30 sec • 3 pts

Which keyword is used to declare a delegate type in C#?

delegate

function

delegateType

method

Answer explanation

The keyword "delegate" is used to declare a delegate type in C#.

3.

MULTIPLE CHOICE QUESTION

30 sec • 4 pts

Delegates in C# support:

Single method call

Multicast delegates

Both a and b

None of the above

Answer explanation

Delegates in C# support single method call as well as multicast delegates (i.e., delegates that can point to multiple methods).

4.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

What is the return type of a delegate?

void

int

string

It depends on the method it points to

Answer explanation

The return type of a delegate depends on the method it points to.

5.

MULTIPLE CHOICE QUESTION

30 sec • 3 pts

Which of the following statements is true about multicast delegates?

They can point to multiple methods.

They can point to only one method.

They cannot be invoked.

They are obsolete in C#.

Answer explanation

Multicast delegates in C# can point to multiple methods.

6.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

Which delegate type is provided by C# for asynchronous programming?

AsyncCallback

AsyncDelegate

AsyncFunction

None of the above

Answer explanation

AsyncCallback delegate type is provided by C# for asynchronous programming.

7.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

Which keyword is used to combine two delegates into a single multicast delegate?

join

merge

+

+=

Answer explanation

The += operator is used to combine two delegates into a single multicast delegate.

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?