---
title: "Comment by Dawid Świst on \"SOLID Principles: Liskov substitution Principle (LSP)\" | Hashnode"
description: "I believe you should consider improving the example in the 'Bad Example (Not Following)' chapter. The Java compilation problem is caused by a difference in the"
url: "https://hashnode.com/posts/solid-principles-liskov-substitution-principle-lsp/65f8d16211e2a45bb27a5488/comment/65f944203aef40b31b85131d"
---

[Discussion](https://hashnode.com/posts/solid-principles-liskov-substitution-principle-lsp/65f8d16211e2a45bb27a5488)

Comment [SOLID Principles: Liskov substitution Principle (LSP)](https://hashnode.com/posts/solid-principles-liskov-substitution-principle-lsp/65f8d16211e2a45bb27a5488)

[Dawid Świst](https://hashnode.com/@9macdev)

[Mar 19, 2024](https://hashnode.com/posts/solid-principles-liskov-substitution-principle-lsp/65f8d16211e2a45bb27a5488/comment/65f944203aef40b31b85131d)

I believe you should consider improving the example in the 'Bad Example (Not Following)' chapter. The Java compilation problem is caused by a difference in the type of the variable and the constructor class.

[Mohamed Khaled Abdelmeguid](https://hashnode.com/@mokhaledmagdi)

[Mar 19, 2024](https://hashnode.com/posts/solid-principles-liskov-substitution-principle-lsp/65f8d16211e2a45bb27a5488/comment/65f944203aef40b31b85131d#reply-65f971540f276f35476de3d4)

Thank you so much for your note.
