Skip to content

Instantly share code, notes, and snippets.

@ajaysjournal
Created January 26, 2019 15:46
Show Gist options
  • Save ajaysjournal/ee7e0f93bf64968fdb7bb442cbc5c474 to your computer and use it in GitHub Desktop.
Save ajaysjournal/ee7e0f93bf64968fdb7bb442cbc5c474 to your computer and use it in GitHub Desktop.
solid-blog
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