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

What are the 2 ways of adding constraints to a route?

796


How does the 'page lifecycle' of asp.net mvc works?

833


Explain entity lifecycle? : Entity framework

824


Where is tempdata stored?

762


Does razor engine supports for tdd?

958


Explain JSON Binding?

877


what is use of entitydatasource control?

881


Explain bundle.config in mvc4?

881


Why to use '{resource}.axd/{*pathInfo}' in routing in ASP.Net MVC?

2387


What is display mode in mvc?

788


Can we change web.config settings from iis?

805


What is the .net framework?

804


What is the purpose of a web form?

776


what is client wins and store wins mode in entity framework concurrency?

967


What is controllercontext?

807