package Movie; import java.util.ArrayList; import java.util.List; public class Movie { private String title; private String director; private List actors; private List reviews; public Movie(String title, String director, List actors) { this.title = title; this.director = director; this.actors = new ArrayList<>(actors); this.reviews = new ArrayList<>(); } public void addReview(String review) { reviews.add(review); } public List getReviews() { return new ArrayList<>(reviews); } public String getMovieDetails() { return String.format("Title: %s\nDirector: %s\nActors: %s\nReviews: %s", title, director, String.join(", ", actors), String.join("\n", reviews)); } public static void main(String[] args) { List actors = new ArrayList<>(); actors.add("Actor 1"); actors.add("Actor 2"); actors.add("Actor 3"); Movie movie = new Movie("The Great Adventure", "Jane Doe", actors); movie.addReview("An amazing film with stunning visuals."); movie.addReview("A fantastic adventure with great performances."); movie.addReview("A bit slow in the middle, but overall enjoyable."); List reviews = movie.getReviews(); System.out.println("Reviews:"); for (String review : reviews) { System.out.println("- " + review); } System.out.println("\nMovie Details:"); System.out.println(movie.getMovieDetails()); } }