> For the complete documentation index, see [llms.txt](https://mm.ricky.moe/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mm.ricky.moe/other/ji-suan-ji-li-lun/solid-yuan-ze/lsp-or-the-liskov-substitution-principle.md).

# LSP | The Liskov Substitution Principle

通俗解释：

* 接受的参数（类型）范围比父类大，返回的类型范围比父类小。可以理解为子类比父类强，父亲能干的事情儿子一定可以，反过来不一定成立。
* 老爸（只有小学毕业）能做的事，儿子（大学生）能做，反之不成立。
