Question: For the following implementations in Main: 1 . 1 . Implement a HashMap call movieYearMap whose key is the movie Year, an Integer, and whose
For the following implementations in Main:
Implement a HashMap callmovieYearMapwhose key is the movie Year, an Integer, and whose Value is a List of all Movies in that year points
Loop over all of the Movies in the data file. Add each movie tomovieYearMap points
import java.io;
import java.util.Scanner; Import the Scanner class to read text
class Main
public static void mainString args
String data;
try
File myObj new FileIMDBMovieData.csv;
Scanner myReader new ScannermyObj;
data myReader.nextLine; Read and ingnore header line in file
while myReaderhasNextLine
data myReader.nextLine;
Movie tempmovie new Movie;
tempmovie parseMoviedata;
If line of data created a valid Movie object
iftempmovie.getTitle "Invaliddata"
Print Movie Obkect details
tempmovie.printMovieDetails;
catch FileNotFoundException e
System.out.printlnAn error occurred.";
eprintStackTrace;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
