Search This Blog

Wednesday, October 13, 2010

Abstract vs Interface

An Interface cannot implement methods.
An abstract class can implement methods.

An Interface can only inherit from another Interface.
An abstract class can inherit from a class and one or more interfaces.

An Interface cannot contain fields.
An abstract class can contain fields.

An Interface can contain property definitions.
An abstract class can implement a property.

An Interface cannot contain constructors or destructors.
An abstract class can contain constructors or destructors.

An Interface can be inherited from by structures.
An abstract class cannot be inherited from by structures.


An Interface can support multiple inheritance.
An abstract class cannot support multiple inheritance.

No comments:

Post a Comment