Object-Oriented Programming Classes
Hey there, For this specific lab assignment, I am in the Driver.java removingthe existing code and replace it with a statement that creates a new instance of the MovieContainer class. Then call the newly created display() method. Of course, there are no movies in the container so you will only see a header. In MovieContainer.java I'm heavily modifying the methods especially the one I'm struggling with right now which is the display() method. For this I need to make the display() work for the Driver.java class to make an instance for the number of entries the movies are so that I can test it. I'm getting an error of NullPointerException and I know why but it's confusing to why it's not there. I drew for a reference on what's causing and I'm trying to figure out how to EMPLOY the number of entries into display() for the sake of testing an instance in the Driver class. Here are my codes: MovieContainer: https://code.sololearn.com/cGPEvNU3Zi04 Driver: https://code.sololearn.com/cl0tPkW8GSk2 Movie class: https://code.sololearn.com/cIz7Cg5IKH3v UPDATE: So I tried doing inside the loop for display() method for(){ movies[I] = new Movie("","",0); System.out.printf("%-30s %-20s %4d\n", movies[I].title, movies[I].genre, movies[I].year); } It gave me an OutOfBoundsException error of 10,000 UPDATE#2: I think the problem with my Driver was creating a variable that has null of MovieContainer and I traced it back to the constructor method in MovieContainer.java. I'm getting an error saying it doesn't recognize "FileInputStream" in there even though I have it imported.