SOLID & OOP Principles (50 Qs)•Part 2: Object-Oriented Design, Code Smells & Refactoring (11 - 24)
How does the Liskov Substitution Principle apply to Exception Contracts?
mid Levelsolid-principlesObject-Oriented Design
In Simple Words: Subclasses cannot throw broader checked exceptions than their superclasses. A subclass method must honor the exception contract of the base abstraction to prevent unexpected crashes.