Question: java using inheritence and polymorphism. 1. Create a superclass Movie with the following properties: title, year, director, and rating. This class should only have a
java using inheritence and polymorphism.
1. Create a superclass "Movie" with the following properties: title, year, director, and rating. This class should only have a parameterized constructor to initialize all the properties of the Movie. Make sure all the property data is validated before assigned to the object. Add accessor, mutator methods as needed.
2. Create subclasses "Action Movie", "Comedy Movie", and "Drama Movie" that inherit from the "Movie" class. Each subclass should have additional properties that are specific to that genre of movie. For example, the "Action Movie" class should have an additional property for the number of stunts in the movie.
3. Add appropriate constructors to the subclasses. 4. Implement the "toString()" method in each class to display the properties of the movie in a meaningful way.
5. Create a method in the "Movie" class that will return the number of movies that have been created. This method should be overridden in each subclass.
6. Create a class "MovieTester" that will test the functionality of the classes. Add a method that will display the properties of any movie object using polymorphism.
7. In the main method in the MovieTester class, Create 1 object for each subclass of Movie. Pass these objects to the method defined in Step 6 to display information about the object.
8. The application should also display the number of movies created for each subclass using the method defined in the classes.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
