4. 4
/**
* The CD class representsaCD object. Informationabout the
* CD is storedandcan be retrieved.
*
* @author Michael KollingandDavidJ.Barnes
* @version2008.03.30
*/
publicclassCD extendsItem
{
private Stringartist;
private intnumberOfTracks;
/**
* Initializethe CD.
* @param theTitle The title of the CD.
* @param theArtistThe artistof the CD.
* @param tracks The numberof tracks on the CD.
* @param time The playingtime of the CD.
*/
publicCD(StringtheTitle,StringtheArtist,inttracks,inttime)
{
super(theTitle,time);
artist= theArtist;
numberOfTracks=tracks;
}
/**
* @return The artistfor thisCD.
*/
6. 6
/**
* The DVD class representsaDVD object. Informationabout the
* DVD isstoredand can be retrieved.We assume thatwe onlydeal
* withmovie DVDsat thisstage.
*
* @author Michael KollingandDavidJ.Barnes
* @version2008.03.30
*/
publicclassDVDextendsItem
{
private Stringdirector;
/**
* Constructorfor objectsof classDVD
* @param theTitle The title of thisDVD.
* @param theDirectorThe directorof thisDVD.
* @param time The runningtime of the mainfeature.
*/
publicDVD(StringtheTitle,StringtheDirector,inttime)
{
super(theTitle,time);
director= theDirector;
}
/**
* @return The directorforthisDVD.
*/
publicStringgetDirector()
{