Register to Better Coder! It's free.
Enjoy the premium features and succeed at every job interview.

What do you know about delegates?

Experience Level: Medior
Tags: .NETC#

Answer

A delegate in C# is similar to a function pointer in C or C++. Using a delegate allows the programmer to encapsulate a reference to a method inside a delegate object. The delegate object can then be passed to code which can call the referenced method, without having to know at compile time which method will be invoked.

Related C# job interview questions

Comments

Anonymous
A delegate in C# is similar to a function pointer in C or C++. Using a delegate allows the programmer to encapsulate a reference to a method inside a delegate object. The delegate object can then be passed to code which can call the referenced method, without having to know at compile time which method will be invoked.
.NET/C# Phone Screening 1
.NET/C# Phone Screening 1

Are you learning C# ? Try our test we designed to help you progress faster.

Test yourself