Interview questions

.Net - What is a delegate?

Next question>>           Learn .NET
.Net - What is a delegate? Explain how to create it. - June 03, 2009 at 11:00 AM by Shuchi Gauri

What is a delegate? Explain how to create it.

A delegate declares a ref type that references a named of anonymous method. Delegates are secure and type-safe. Consider them as type safe function pointers.

public delegate void Del<T>(T item);

Del<int> d1 = new Del<int>(Notify);

Next question>>

Also read

Explain how to implement Delegates in C#.NET

Here is an implementation of a very simple delegate that accepts no parameters.................

What are delegates and why are they required?

The delegates in .NET are like the pointers to the functions in C/C++. The difference is that these are type safe unlike the once in C/C++.................

What is the difference between Factory and Abstract Factory Patterns?

The difference between Factory and Abstract Factory Patterns lies in object instantiation. In Abstract factory pattern Composition is used to delegate object instantiation by a class to some object................

.NET delegates and events

What is an Event?
Define Delegate.
What is the purpose of AddHandler keyword?...............

Difference between abstract classes and interfaces.

When a derived class is inherited from an Abstract class, no other class can be extended then. Interface can be used in any scenario................. 



Write your comment - Share Knowledge and Experience


 

 
Latest placement tests
Latest links
 
Latest MCQs
» General awareness - Banking » ASP.NET » PL/SQL » Mechanical Engineering
» IAS Prelims GS » Java » Programming Language » Electrical Engineering
» English » C++ » Software Engineering » Electronic Engineering
» Quantitative Aptitude » Oracle » English » Finance
Home | About us | Sitemap | Contact us | We are hiring