public static void main(String [] args)
{
FilmData MyFilm[] = new FilmData[4];
Scanner input = new Scanner(System.in);
int count=0;
for (int i=0; i<MyFilm.length; i++)
{
count=i+1;
System.out.println("Details for Movie"+count);
System.out.println("---------------------");
System.out.println("Type the movie name");
String movie=input.nextLine(); // Get error in the 2nd loop when data is input
// I think this is an error in Java. But is there a way to handle this?
System.out.println("Type the length in minutes");
int length=input.nextInt();
MyFilm[i] = new FilmData(movie,length);
}
}