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 can you enhance the performance of entity framework?

589


What is difference between html.beginform and ajax.beginform?

599


If we write any code for DataGrid methods, what is the access specifier used for that methods in the code behind file and why?

1968


Which are the important namespaces used in mvc?

710


Explain the role of assembly in the .net framework.

562






what is entity sql?

600


What are action filters?

596


Name a few different return types of a controller action method?

535


What is web api‘s in asp.net mvc 4 ?

580


Mention two instances where routing is not implemented or required?

741


What is objectset? : Entity framework

546


What are the 3 main components of an asp.net mvc application?

534


What is entity sql? : Entity framework

557


What is .net architecture?

537


Define the core components of an ASP.NET MVC application?

571