loading...

re: A guide to Solid principles in java VIEW POST

TOP OF THREAD FULL DISCUSSION
re: To me, the Liskov Substitution Principle (LSP) was best explained as "require no more, ensure no less." Require no more: any valid input for the s...
 

Thank you for the good explaination.
Yes, Java prevents LSP violations while overriding the method. It does not allow you to change return type, however you can return instance of subtype also known as Covariant return type.

code of conduct - report abuse