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(); } }

The class DvdCommandNameStarsOff extends the class CommandAbstract. The constructor DvdCommandNameStarsOff takes the argument dvdNameIn of type DvdName and assigns that to the field dvdName. The function execute calls the function setNameStarsOff on the object referenced by dvdName.

Questions about programming?Chat with your personal AI assistant