Design Patterns, Behavioural Design, Java, Software Development.
TurnOffLightCommand implements Command { private Light light; public TurnOffLightCommand(Light light) { this.light = light; } @Override public void execute() { light.turnOff(); } } 3. Implement the Receiver // Receiver class public class Light { public void turnOn() { System.out.println("Light is