Skip to content

Instantly share code, notes, and snippets.

@ajayverse404
Created January 26, 2019 15:47
Show Gist options
  • Select an option

  • Save ajayverse404/8b0d70f43b063ed6cbf64bdf37994a73 to your computer and use it in GitHub Desktop.

Select an option

Save ajayverse404/8b0d70f43b063ed6cbf64bdf37994a73 to your computer and use it in GitHub Desktop.
solid-blog
public interface Robot {
void run();
void shoot();
void swim();
void fight();
void walk();
}
// company A wants to extend the Robot to add Speaking feature
public SpeakingRobot extends Robot {
@Overrides
void run() {
// .. inherits from Robot
}
@Overrides
void shoot() {
// do nothing
// return;
}
@Overrides
void swim() {
// do nothing
// return;
}
@Overrides
void fight(){
// do nothing
// return;
}
@Overrides
void walk() {
// .. inherits from Robot
}
@Overrides
void speak() {
// code to speak
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment