IBird
Fly()
IFlyingBird
Quote:Here, the KingFisher class extends the Bird base class and hence inherits the Fly() method, which is pretty good. Now take a look at the following example: Corrected class hierarchy of Liskov Substitution Principle Ostrich is a Bird (definitely it is!) and hence it inherits the Bird class. Now, can it fly? No! Here, the design violates the LSP. ...
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)