What are the differences between Abstract class and Interface?

  • Abstract classes can contain abstract methods without body as well as concrete methods with body
  • Interfaces can't contain concrete methods with body
  • Abstract classes are extended by their sub classes and any abstract method needs to be overrriden by their sub classes
  • Interfaces are implemented by their sub types and all the methods or properties defined in the interface must be implemented by their sub types
  • a class CANNOT extend two or more abstract classes
  • a class CAN implement two or more interfaces
  • Abstract classes can contain abstract methods without body as well as concrete methods with body
  • Interfaces can’t contain concrete methods with body
  • Abstract classes are extended by their sub classes and any abstract method needs to be overrriden by their sub classes
  • Interfaces are implemented by their sub types and all the methods or properties defined in the interface must be implemented by their sub types
  • a class CANNOT extend two or more abstract classes
  • a class CAN implement two or more interfaces
Sriram Mannava
Sriram Mannava

I'm a full-stack developer and a software enthusiast who likes to play around with cloud and tech stack out of curiosity.

Leave a Reply

Your email address will not be published. Required fields are marked *