You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
637 B
23 lines
637 B
public abstract class Movie implements MoviePlayable {
|
|
private String title;
|
|
private int year;
|
|
private double rating;
|
|
private String genre;
|
|
|
|
public Movie(String title, int year, double rating, String genre) {
|
|
this.title = title;
|
|
this.year = year;
|
|
this.rating = rating;
|
|
this.genre = genre;
|
|
}
|
|
|
|
// 接口方法,留给子类实现
|
|
@Override
|
|
public abstract void play();
|
|
|
|
// getter
|
|
public String getTitle() { return title; }
|
|
public int getYear() { return year; }
|
|
public double getRating() { return rating; }
|
|
public String getGenre() { return genre; }
|
|
}
|