finishin Movie.java
This commit is contained in:
@@ -6,8 +6,9 @@ public class Movie {
|
|||||||
private int year;
|
private int year;
|
||||||
|
|
||||||
public Movie(String title, double rating, int year) {
|
public Movie(String title, double rating, int year) {
|
||||||
// TODO: Initialize the instance variables (this.title, this.rating, this.year)
|
this.title = title;
|
||||||
// with the values passed as arguments to this constructor.
|
this.rating = rating;
|
||||||
|
this.year = year;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getTitle() {
|
public String getTitle() {
|
||||||
@@ -24,9 +25,7 @@ public class Movie {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
// TODO: Return a string representation of the movie matching the exact required format.
|
return "Movie: " + title + ", Rating: " + rating + ", Year: " + year;
|
||||||
// Example format: "Movie: The Godfather, Rating: 9.2, Year: 1972"
|
|
||||||
return "";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user