The new class definition is (in part) below.
The MusicVideo class is a subclass of Video.
A skeleton of the definition is below.
The Movie class is not shown,
but is also a subclass of Video.
class Video
{
protected String title; // name of the item
protected int length; // number of minutes
protected boolean avail; // is the video in the store?
// constructor
public Video( String ttl, int lngth )
{
title = ttl; length = lngth; avail = true;
}
public void toString()
{
return title + ", " + length + " min. available: " + avail ;
}
// setters and getters
. . .
}
class MusicVideo extends Video
{
private String artist;
private String category;
// The constructor will go here
// The toString() method will go here
}
What instance variables are members of the class MusicVideo?