From 733e0376fa287a09e2ea8022b41fe07330c394e6 Mon Sep 17 00:00:00 2001 From: Bita Date: Mon, 11 May 2026 13:19:43 +0330 Subject: [PATCH] Complete classs Movie --- 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..e01e9c8 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 : " + getTitle() + ", Rating : " + getRating() + ", Year : " + getYear(); } @Override