Skip to content

Instantly share code, notes, and snippets.

@Naomi-Dennis
Created November 15, 2019 21:13
Show Gist options
  • Save Naomi-Dennis/1f74e334ea3bda11b69dd35d0a8b9515 to your computer and use it in GitHub Desktop.
Save Naomi-Dennis/1f74e334ea3bda11b69dd35d0a8b9515 to your computer and use it in GitHub Desktop.
class WallPoweredDevice {
public void plugInPower() {
}
}
interface InternetDevice {
public void connectToDeviceViaEthernetCord(InternetDevice device);
}
class Router extends WallPoweredDevice implements InternetDevice {
public void connectToDeviceViaEthernetCord(InternetDevice device) {
}
}
class Main {
public static void main(String[] args) {
Router linksys = new Router();
Television tv = new Television();
linksys.connectToDeviceViaEthernetCord(tv);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment