Learn IT

Free learning anything to everything in Information Technology.

Abstract Class Vs Interface

Interfaces:
  1. Interfaces doesn’t have constructors
  2. Can implement multiple inheritances.
  3. Contain only abstract methods (Only method prototype is declared)
  4. Can not create object for interfaces.
  5. Interfaces are reference type.
  6. An interface can implement by multiple classes.
  7. A derived class can implement multiple interfaces, but can inherit from only one class (abstract or not).
  8. Interfaces are default public.

Abstract Class:

  1. Abstract classes can have constructors.
  2. Can’t implement multiple inheritances.
  3. Contain abstract methods and general methods also.
  4. Can not create object for abstract class.
  5. Abstract classes are reference type.

0 comments: