Practice mode C#

What is a delegate in C#?

Correct answer D. A type-safe reference to a method with a specific signature

Explanation

A delegate type defines a method signature, and a delegate instance holds a reference to one or more methods matching it, which can be invoked later. This lets methods be passed as arguments, used as callbacks and combined into events. Delegates are type-safe: the compiler rejects methods whose parameters or return type do not match.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.