Question
in java Create a class Movie with following attributes: private int id; private String title; private int year; private List genres; private Director director; Create
in java Create a class Movie with following attributes: private int id; private String title; private int year; private List genres; private Director director; Create two more classes: Class Genre with following attributes: private int id; private String name; Class Director with following attributes private int id; private String name; Generate parametrized constructors and getters and setters for all classes In the main method initialize list of movies with following example values: Movie title: The Shawshank Redemption, Movie director: Frank Darabont, Year: 1994, Genres: [Drama] Movie title: The Godfather, Movie director: Francis Ford Coppola, Year: 1972, Genres: [Drama, Crime] Movie title: The Godfather: Part II, Movie director: Francis Ford Coppola, Year: 1974, Genres: [Drama, Crime] Movie title: Pulp Fiction, Movie director: Quentin Tarantino, Year: 1994, Genres: [Crime, Drama] Movie title: Whiplash, Movie director: Damien Chazelle, Year: 2014, Genres: [Drama, Music] Movie title: Once Upon a Time in Hollywood, Movie director: Quentin Tarantino, Year: 2019, Genres: [Drama, Music] Movie title: The Prestige, Movie director: Christopher Nolan, Year: 2006, Genres: [Drama, Mystery , Sci-Fi, Thriller] For the Director id and Genre id you can use either random or hard coded number but the same genre/director should have the same id. Using java stream create a program that will: print the movie details as shown above Print the list of all movie directors (without duplicates) Print all movie titles from Quentin Tarantino (Only the move titles, not the whole objects)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started