Abstract Class vs Interface Interface Meaning Defines capability and behavior contract Use when: ● Multiple inheritance is required ● System uses plug-in extensibility ● Loose coupling is necessary public interface IPayment { void Pay(decimal amount); }
bstract Class Meaning
Provides base behavior with shared implementation
Represents IS-A inheritance relationship
public abstract class PaymentBase
{
public void Log() => Console.WriteLine("Payment logged");
public abstract void Pay(decimal amount);
}
Summary
Interface = Capability
bstract Class = Shared Base Behavior