Created
December 8, 2023 16:01
-
-
Save suhailgupta03/17097e2a3a29b866f76d9dbf79a0ace1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Interface Segregation Principle (ISP): Clients should not be forced to | |
* depend on interfaces they do not use. | |
*/ | |
class Animal { | |
eat(){} | |
} | |
class FlyingAnimal extends Animal { | |
fly(){ | |
// fly | |
} | |
} | |
class FlyingMammal extends FlyingAnimal { | |
feedWithMilk(){} | |
} | |
class SwimmingAnimal extends Animal { | |
swim(){ | |
// swim | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment