Delegates

Delegates

University

20 Qs

quiz-placeholder

Similar activities

BCS Network Security Quiz 5

BCS Network Security Quiz 5

University - Professional Development

17 Qs

REVISION 4 : TOPIC 3, 4, 5 & 7

REVISION 4 : TOPIC 3, 4, 5 & 7

1st Grade - University

20 Qs

ED3802ศึกษาสังเกต2

ED3802ศึกษาสังเกต2

University

15 Qs

IIR & FIR FILTER DESIGN

IIR & FIR FILTER DESIGN

University

20 Qs

NDT -QUIZ- 4

NDT -QUIZ- 4

University

20 Qs

M06 COOKIES PRODUCT

M06 COOKIES PRODUCT

University

20 Qs

Task-based Language Teaching (TBLT)

Task-based Language Teaching (TBLT)

University

15 Qs

Cytogenetics

Cytogenetics

University

15 Qs

Delegates

Delegates

Assessment

Quiz

Education

University

Practice Problem

Hard

Created by

Innocent Manganyi

Used 1+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?