Question
JAVA Task 1: Design a class called Movie that has the following private fields: serial: int title: String genre: String rent_fee: double 1. The Movie
JAVA
Task 1: Design a class called Movie that has the following private fields:
serial: int
title: String
genre: String
rent_fee: double
1. The Movie class should have the following constructors:
Full-argument constructor
No-argument constructor
Copy constructor
2. Provide setter and getter methods for each field
3. Override the toString() method to return a String with the following format:
Movie(345, Titanic, Romance, 25.5 SAR per day)
Assuming that the object fields were initialized to 345, Titanic, Romance, and 25.5
4. Override the equals() method to return true if the Movie objects have the same title and false otherwise.
Task 2: Write a test class called TestMovie where you will create 3 Movie objects using the 3 constructors.
1. Use the following arguments to call the full-argument constructor:
345, Titanic, Romance, and 25.5
2. Set the rent fee of the first Movie object to 15.5.
3. Print the content of the first and third objects.
4. Check if the first and second objects are equal
Step by Step Solution
3.36 Rating (149 Votes )
There are 3 Steps involved in it
Step: 1
creating the movie class class Movie variables private int serial private String title genre private ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started