Created
January 26, 2019 15:46
-
-
Save ajaysjournal/ee7e0f93bf64968fdb7bb442cbc5c474 to your computer and use it in GitHub Desktop.
solid-blog
This file contains 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
public interface Everything { run() } | |
// similar to Object class(root class, it has most generalized methods) in Java | |
public class HumanoidRobot extends Everything { | |
public void run() { | |
// code to run using batteries. | |
} | |
} | |
public class Human extends Everything { | |
public void run() { | |
// code to run using physical streangth. | |
} | |
} | |
// Example: | |
Everything ev = new HumanoidRobot() | |
Everything ev = new Human() | |
// if you apply the substition rule it satisfies, since both does the run operation but differently. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment