code to explanationWed, 28 Dec 2022

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

The DvdCommandNameStarsOn class implements the execute method of the Command interface and is a Command Object. When the execute method is called the dvdName object's setNameStarsOn method is called.

Questions about programming?Chat with your personal AI assistant