code to explanationWed, 28 Dec 2022

public class DvdCommandNameStarsOff extends CommandAbstract { private DvdName dvdName; public DvdCommandNameStarsOff(DvdName dvdNameIn) { this.dvdName = dvdNameIn; } public void execute() { this.dvdName.setNameStarsOff(); } }

This is the concrete command object that takes the Receiver object and knows what action to call on the receiver object. The concrete command object has a reference to the Receiver object.

Questions about programming?Chat with your personal AI assistant