SOLID & OOP Principles (50 Qs)•Part 2: Object-Oriented Design, Code Smells & Refactoring (11 - 24)
What are Preconditions and Postconditions in Design by Contract (LSP)?
junior Levelsolid-principlesObject-Oriented Design
In Simple Words:
- Preconditions: Cannot be strengthened in a subtype (cannot demand stricter inputs).
- Postconditions: Cannot be weakened in a subtype (cannot guarantee less outputs).