Menu ▼



Posted By :
avatarmrkraju
Total Views : 2495

Difference between abstract and virtual method

Abstract Method:
  1. If abstract method is defined in a class, then the class should declare as abstract class.
  2. Abstract method should contain only method definition, should not contain the method body / implementation.
  3. Abstract method must be over ride in the derived class.
Virtual Method:
  1. Virtual methods can be over ride in the derived class but not mandatory.
  2. Virtual methods must have the method body / implementation along with definition.

Example :








comments powered by Disqus


Search dotnetlearners.com