Banner Ad

Monday, January 27, 2014

Daily Interview Questions #4: What is the difference between Abstract Method and Virtual Method?

By Francis   Posted at   1:29 PM   OOPS interview Questions No comments

Abstract Method:

Abstract method specified by “abstract” keyword.

An abstract method contains no definition. Derived class must implement the abstract methods.

Object cannot be created for abstract class. That is abstract class can not be instantiated.

Virtual Method:

Virtual method specified by “virtual” keyword.

Used to implement “Run-Time” polymorphism.

Derived classes not forced to implement the “Virtual” methods that is available in Base class.

The process of redefine the virtual method in a derived class called as “Method Overridding”.

About Francis

Francis, an Associate at Cognizant. Having 7+ Years of experience in Microsoft web technologies.

0 comments :

Please give your valuable comments to improve the contents

Connect with Us