林非常非常新到Java。 我试着去让返回关于几部电影(所有这些信息都存储在阵列)一些信息一类。 林坚持和不知道该怎么做。 这里是我的代码
电影类:
public class Movie {
String[] Director;
String[] Name;
String[] realeaseDate;
String[] lastShow;
public Movie()
{
String[] Director={"George Romero","Woody Allen","Steven Speilberg","James Cameron"};
String[] Name={"Diary of the Dead","Midnight in Paris","War of the Worlds","Terminator 2 - Judgment Day"};
String[] realeaseDate={"Dec 31 1999","Dec 28 1999","Dec 15 1999","Dec 10 1999"};
String[] lastShow={"Jan 13 2000","Jan 29 2000","Jan 23 2000","Jan 15 2000"};
}
public String getDirector()
{
return Director;
}
public String getName()
{
return Name;
}
public String getRealease()
{
return realeaseDate;
}
public String getLast()
{
return lastShow;
}
}
现在,这里是我公司主营:
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
String newLine = System.getProperty("line.separator");
Movie movies = new Movie();
System.out.println("Avaliable movies"+newLine);
System.out.println("Director: "+ movies.getDirector()+newLine+"Name :"+ movies.getName()+ newLine + "Realease Date: "+ movies.getRealease()+newLine+"Last Show :"+ movies.getLast()+newLine);
}
}
我想要的结果是这样的:
所有可用的电影
乔治...的日记... ...月... januar
史蒂芬.. sdafsda ... ...月...一月
。 。 。