.NET interview questions: - Different Ways to create a delegate?
- By Shiv Prasad Koirala in ASP.NET
- Sep 20th, 2011
- 21834
- 0
This is the .NET interview questions which you come across many a times. So following is the answer to it with explanation.
Creating a delegate is four step process:-
• Declare a delegate.
• Create an object reference.
• Point the reference to the method.
• Invoke the method via the delegate.
Below is the code snippet for the same.
// Declare a delegatepublic delegate int PointToAdd(int i, int y);// Create a reference pointerPointToAdd objpointer = null;// Point to the methodobjpointer = Add;// Invoke the function/methodobjpointer.Invoke(10,20);
See the following video on different types of collection in .NET and C#: -
interview questions and answers for .NET for preparation of real time interviews.
Regards,
Get more from author's blogs for Most asked .NET interview questions
Shiv Prasad Koirala
Visit us @ www.questpond.com or call us at 022-66752917... read more

- By Shiv Prasad Koirala
- Jun 21st, 2013
- 163996
- 0
.NET interview questions 6th edition (Sixth edition) - By Shivprasad Koirala

- By Shiv Prasad Koirala
- Dec 8th, 2016
- 89214
- 0
Exception Handling in C# using example step by step

- By Shiv Prasad Koirala
- Sep 7th, 2013
- 72042
- 0