Skip to content

Instantly share code, notes, and snippets.

@anjanashankar9
Created August 1, 2021 11:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anjanashankar9/c3076c12a6a08310979e272b2d45333c to your computer and use it in GitHub Desktop.
Save anjanashankar9/c3076c12a6a08310979e272b2d45333c to your computer and use it in GitHub Desktop.
public class TurnTVOn implements Command {
Device device;
public TurnTVOn(Device device) {
this.device = device;
}
@Override
public void execute() {
device.on();
}
}
public class TurnTVOff implements Command {
Device device;
public TurnTVOff(Device device) {
this.device = device;
}
@Override
public void execute() {
device.off();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment