movie.java

来自「ssd3 practical quiz 8」· Java 代码 · 共 40 行

JAVA
40 行
字号


public abstract class Movie {
	/* the title of the movie*/
	private String title;
	
	/*the name of the actors in the movie*/
	private String[] actors;
	
	/* the director of the movie*/
	private String director;
	/*constructor*/
	public Movie(String initialTitle,
		       String[] initialActors,
		       String initialDirector) {
		this.title = initialTitle;
		this.actors = initialActors;
		this.director = initialDirector;
	}
	/*return the value of title*/ 
	public String getTitle() {
		return this.title;
	}
	
	/*return the reference to the array of actors*/
	public String[] getActors() {
		return this.actors;
	}
	
	/*return the value of the director*/
	public String getDirector() {
		return this.director;
	}
	
	/*to string*/
	public String toString() {
		return this.title;
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?