vault backup: 2024-09-05 17:56:43
This commit is contained in:
56
Unsorted/Part 4 Complete - 00677611/Part 4 Complete/DVD.java
Normal file
56
Unsorted/Part 4 Complete - 00677611/Part 4 Complete/DVD.java
Normal file
@@ -0,0 +1,56 @@
|
||||
|
||||
/**
|
||||
* Subclass of AudioVisual to create objects of DVD items.
|
||||
*
|
||||
* @George Wilkinson
|
||||
* @1.2
|
||||
*/
|
||||
|
||||
import java.util.Scanner;
|
||||
|
||||
public class DVD extends AudioVisual
|
||||
{
|
||||
private String director;
|
||||
|
||||
/**
|
||||
* Constructor for objects of class DVD
|
||||
* Since all field variables initialise as null, nothing should happen here.
|
||||
*/
|
||||
public DVD(){}
|
||||
|
||||
/*
|
||||
* Return value of @director.
|
||||
*/
|
||||
public String getDirector()
|
||||
{
|
||||
return director;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set value of @director.
|
||||
*/
|
||||
public void setDirector( String director )
|
||||
{
|
||||
this.director = director;
|
||||
}
|
||||
|
||||
/*
|
||||
* Print relevant details of the current object.
|
||||
*/
|
||||
public void printDetails() {
|
||||
System.out.println( "Director: " + director );
|
||||
super.printDetails();
|
||||
}
|
||||
|
||||
/**
|
||||
* Populate the fields with details from the scanner
|
||||
* Takes Parameters
|
||||
* Scanner @detailScanner
|
||||
*/
|
||||
public void readItemData( Scanner detailScanner ){
|
||||
if ( detailScanner != null ) {
|
||||
this.director = detailScanner.next().trim();
|
||||
super.readItemData( detailScanner );
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user