The new class definition is (in part) below.
The MusicVideo
class is a subclass of VideoTape
.
A skeleton of the definition is below.
The Movie
class is not shown,
but is also a subclass of VideoTape
.
Remember that a class can have several subclasses.
class VideoTape { String title; // name of the item int length; // number of minutes boolean avail; // is the tape in the store? // constructor public VideoTape( String ttl, int lngth ) { title = ttl; length = lngth; avail = true; } public void show() { System.out.println( title + ", " + length + " min. available:" + avail ); } } class MusicVideo extends VideoTape { String artist; String category; // The constructor will go here // The show() method will go here }