Delegates

Delegates

University

20 Qs

quiz-placeholder

Similar activities

Prelim for Agricultural Marketing

Prelim for Agricultural Marketing

University

20 Qs

Approaches and Methods in Teaching AP in the Intermediate Grades

Approaches and Methods in Teaching AP in the Intermediate Grades

University

15 Qs

Exam 1 - Business in Project Management

Exam 1 - Business in Project Management

University

20 Qs

Lesson 6: Quiz

Lesson 6: Quiz

University

15 Qs

Unit- II

Unit- II

University

17 Qs

ESTIMATION OF SOC

ESTIMATION OF SOC

1st Grade - University

21 Qs

Pedagogy of English

Pedagogy of English

University

20 Qs

first quzziz

first quzziz

University

19 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?