Easy learning with example program codes

Liskov Substitution Principle java

It is a SOLID design principle and represent “L” on the SOLID acronym. According to LSP subtypes must be substitutable for supertype. The main concept behind LSP SOLID design principle is that derived class or subclass must enhance functionality not reduce.

For example we have Animal class with a MakeNoise() method then any subclass of Animal should implement makeNoise().

Please follow and like us:

Copyright © 2020 CodesJava Protection Status