What are delegates?where are they used

Answer Posted / kirti

A delegate defines a reference type that can be used to encapsulate a method with a specific signature. A delegate instance encapsulates a static or an instance method. Delegates are roughly similar to function pointers in C++; however, delegates are type-safe and secure.

When do you use virtual keyword ?.

When we need to override a method of the base class in the sub class, then we give the virtual keyword in the base class method. This makes the method in the base class to be overridable. Methods, properties, and indexers can be virtual, which means that their implementation can be overridden in derived classes.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

which are the key concepts of entity data model?

817


Explain the difference between Viewbag and Viewdata in ASP.NET MVC?

789


Explain .Net Framework? Why we use it?

825


What is the difference between partial and renderpartial?

702


Explain dependency resolution?

826


I want to fetch data from datareader. i have three tables in datareader. i want to bind my two table with datagrid, then i want to fetch a value from my third table. do u have any idea pls help me. we use dr.nextresult() for multiple tables.

2398


Does Tempdata hold the data for other request in ASP.Net MVC?

742


What are scaffold templates in mvc?

767


mention in what all scenarios entity framework can be applicable?

1174


How you can implement custom validation in asp.net MVC?

802


What are the main features of asp.net mvc 4 used by asp.net web api?

777


What are the benefits of .net framework?

754


What is the purpose of a web form?

751


What does mvvm mean?

755


Is .net framework backwards compatible?

807