What is virtual function?

 Posted by Tripati_tutu on 1/4/2011 | Category: C# Interview questions | Views: 7041 | Points: 40
Answer:

To provide a specialized implementation in a class, we can mark the member function name as virtual which can be overridden in the subclasses. We can declare methods, indexers, events, and properties as virtual in a class.

It implements the concept of polymorphism. If a class that overrides the virtual method then it has to use the override keyword.


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response