Hi,
I need to write from an array to an outfile. The code is below. My teacher says I need an additional loop somewhere, but I'm not sure where. Anything will help. Thanks!
public static void saveToFile() throws FileNotFoundException { PrintWriter outFile = new PrintWriter("theaterMovieData.txt"); for(int i = 0; i < numTheaters; i++) { if(theaterObject[i] == null) break; Movie[] movieList = theaterObject[i].getMovies(); outFile.println(theaterObject[i].getTheaterName() + " " + movieList[i].getMovieName() + " " + movielist[i].getMoviePrice()+ "0" + "END_OF_THEATER"); } outFile.println("END_OF_FILE"); outFile.close(); }