-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDVD.java
More file actions
26 lines (21 loc) · 676 Bytes
/
Copy pathDVD.java
File metadata and controls
26 lines (21 loc) · 676 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package dome;
public class DVD extends Item{
private String director;
private String production;
public DVD(String title, String director, int playingTime, String production) {
super(title,playingTime,false);
this.director = director;
this.production= production;
}
public static void main(String[] args) {
// TODO Auto-generated method stub
DVD dvd = new DVD("Call Me by Your Name", "Luca Guadagnino", 0, "SonyClassic");
dvd.print();
}
public void print() {
// TODO Auto-generated method stub
System.out.print("DVD:" );
super.print(); // 指示去调用父类的print函数
System.out.println(" | "+director);
}
}