Nithin Bekal

Posts About Notes Slides

Liskov Substitution Principle

Subclasses should be substitutable for their base classes. Avoid violating the contract of the base class in subclasses.

  • Use inheritance only if you want the subclass to be substitutable
  • External behavior of subclass must be compatible with that of parent class