From 3b6502ac9c6ff00593a5d8ecf3cd478db7cc1baa Mon Sep 17 00:00:00 2001 From: ShayanEdalatjoo Date: Fri, 17 Jul 2026 21:04:19 +0330 Subject: [PATCH] finishin Movie.java --- src/main/java/Movie.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/Movie.java b/src/main/java/Movie.java index fc257fe..c2e99cb 100644 --- a/src/main/java/Movie.java +++ b/src/main/java/Movie.java @@ -6,8 +6,9 @@ public class Movie { private int year; public Movie(String title, double rating, int year) { - // TODO: Initialize the instance variables (this.title, this.rating, this.year) - // with the values passed as arguments to this constructor. + this.title = title; + this.rating = rating; + this.year = year; } public String getTitle() { @@ -24,9 +25,7 @@ public class Movie { @Override public String toString() { - // TODO: Return a string representation of the movie matching the exact required format. - // Example format: "Movie: The Godfather, Rating: 9.2, Year: 1972" - return ""; + return "Movie: " + title + ", Rating: " + rating + ", Year: " + year; } @Override