Question: public class Movie { private String title; private String description; private LocalDate dateCreated; public Movie ( String title, String description ) { this.dateCreated = LocalDate.now

public class Movie {
private String title;
private String description;
private LocalDate dateCreated;
public Movie(String title, String description){
this.dateCreated=LocalDate.now();
this.title = title;
this.description = description;
}
public LocalDate getDateCreated(){
return dateCreated;
}
public void setDescription(String description){
this.description = description;
}
public String getDescription(){
return description;
}
public void setTitle(String title){
this.title = title;
}
public String getTitle(){
return title;
}
}
class MovieTest {
public static void main(String[] args){
Movie testAcct = new Movie("Jurassic","Old movie");
testAcct.setDescription("Remade Movie");
System.out.println(testAcct.toString());
}
}
What does the toString() method need to look like to result in the following output (note that the date will reflect your current date instead:
Title: Jurassic
Description: Remade Movie
Date Created: 6/9/2022

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!