From 963153c0b31f2dd925ac6118e55b0f56047020d9 Mon Sep 17 00:00:00 2001 From: HadiSharifi Date: Wed, 13 May 2026 15:29:45 +0330 Subject: [PATCH] complete Movie class --- src/main/java/Movie.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/Movie.java b/src/main/java/Movie.java index fc257fe..3a91221 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,8 @@ 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 ""; + String result = "Title: " + title + ", Rating: " + rating + ", Year: " + year; + return result; } @Override