Skip to main content

What is the difference between abstract classes and interfaces?

Mid PHP
Quick Answer Abstract classes can have concrete methods and properties, and are extended with extends. Interfaces only define method signatures, implemented with implements. A class can implement multiple interfaces but extend only one abstract class. Use abstract class for shared base behavior. Use interface for defining a contract that multiple unrelated classes should follow.

Answer

Abstract classes contain shared logic plus abstract methods. Interfaces define method signatures. Interfaces enforce capabilities; abstract classes share implementation.
S
SugharaIQ Editorial Team Verified Answer

This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice