Where did this light came from? We need to put the HeatingSystem in constructor, but u are doing this:
HeatingSystem heatingSystem = new HeatingSystem();
and then putting light HeatingSystem out of nowhere
Command heatOn = new HeatingOnCommand(light);
Command heatOff = new HeatingOffCommand(light);
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Where did this light came from? We need to put the HeatingSystem in constructor, but u are doing this:
HeatingSystem heatingSystem = new HeatingSystem();
and then putting light HeatingSystem out of nowhere
Command heatOn = new HeatingOnCommand(light);
Command heatOff = new HeatingOffCommand(light);