This commit is contained in:
Arefe Talebi
2026-05-14 20:57:03 +03:30
parent 7e0386ce16
commit ff4f6e0f83
3 changed files with 43 additions and 19 deletions
+4 -3
View File
@@ -7,7 +7,9 @@ public class Movie {
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() {
@@ -25,8 +27,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