1.

Difference Between Abstract Classes And Interfaces

Answer»

ABSTRACT classes:

  • An abstract class can implement methods.
  • An abstract class can inherit from a class and one or more INTERFACES.
  • An abstract class can contain fields.
  • An abstract class can implement a property.
  • An abstract class can contain CONSTRUCTORS or destructors.
  • An abstract class cannot be inherited from by structures.
  • An abstract class cannot support multiple INHERITANCE.

interfaces:

  • An Interface cannot implement methods.
  • An Interface can only inherit from ANOTHER Interface.
  • An Interface cannot contain fields.
  • An Interface can contain property definitions.
  • An Interface cannot contain constructors or destructors.
  • An Interface can be inherited from by structures.
  • An Interface can support multiple inheritance.

Abstract classes:

interfaces:



Discussion

No Comment Found