magento2 – What is the difference between Interface and Abstract Magento 2 classes?

Basically, the main difference between Interface and Abstract classes as below.

Abstract class:

Abstract classes can have constants, members, method stubs (non-body methods), and defined methods, while interfaces can only have constants and method stubs.

Methods and members of an abstract class can be defined with any visibility, while all methods of an interface must be defined as public (they are defined by default).

When it inherits from an abstract class, a concrete child class needs to define abstract methods, whereas an abstract class can extend another abstract class and the abstract methods of the parent class do not have to to be defined.


Similarly, an interface that extends another interface is not responsible for implementing methods from the parent interface. Indeed, the interfaces can not define any implementation.

A child class can extend only one class (abstract or concrete), while an interface can be expanded or a class can implement several other interfaces.

A child class can define abstract methods with the same or less restrictive visibility, while a class implementing an interface must define the methods with the same (public) visibility.

Refer to the link for more information: