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

How we can call a JavaScript function on the change of a Dropdown List in ASP.Net MVC?

564


how do you query in entity model when the result has a join from from different database other than the entity model?

558


Explain two instances where routing is not implemented or required?

592


What is the purpose of a web form?

552


Mention what is the difference between “ActionResult” and “ViewResult” ?

578






what is lazy loading in entity framework?

595


The order of the filters that get executed, if the multiple filters are implemented?

617


Is http stateful or stateless?

551


what is ssdl?

684


What are authentication filters in web api?

577


Can a view be shared across multiple controllers? If yes, how we can do that?

591


What is the difference between tempdata and viewbag?

499


What is the need of Action Filters in ASP.Net MVC

571


Explain the new features added in version 4 of mvc (mvc4)?

543


My organization went through the approval process of supporting the .net framework 2.0 in production. Do we need to go through the same process all over again for the .net framework 3.0? Do I need to do any application compatibility testing for my .net framework 2.0 applications?

562