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 class DvdCommandNameStarsOn extends CommandAbstract to create a new command object that will call a method on the object whose class implements the DvdName interface.

Want to kickstart your project?Use the new AI Studio to create your code