GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Interview Questions  >  Microsoft  >  ASP.NET 2.0

 Print  |  
Question:  can an abstract method be overridden by a virtual method



September 09, 2006 12:09:26 #3
 anishcp   Member Since: August 2006    Total Comments: 6 

RE: can an abstract method be overridden by a virtual ...
 

An abstract method is a method without any method body. When a class inherits from an abstract class, the derived class must implement all the abstract methods declared in the base class. But by declaring the derived class also abstract, we can avoid the implementation of all or certain abstract methods. This is what is known as partial implementation of an abstract class.

A virtual method specifies an implementation of a method than can be polymorphically override in the derived class. When we declare a virtual method, it must contain a method body. It is not necessary to override a base class virtual method inside a derived class.

The abstract methods are implicitly virtual and hence they cant make explicitly virtual in c#

     

 

Back To Question