Question
For this assignment we will be making use of inheritance to keep from having to redefine many of the common attributes associated with different types
For this assignment we will be making use of inheritance to keep from having to redefine many of the common attributes associated with different types of containers. You will be defining a general Container class that will have the common attributes of all types of containers and then you need to define three different types of containers (there are many types of containers, however, some examples may be boxes, bottles, drawers, etc). Be creative when coming up with what types of containers you want to define more specifically. At a minimum, you should define the material the container is made of, the color of it, whether it is filled or not, what it is filled with, how much of that it is filled, and a toString method to create a String version of your object for printing. Additional attributes are encouraged. For a 10 point bonus, define a subclass of one of your subclasses to be an even more specialized version of it. Requirements: ? A general Container class that your other classes will inherit from. ? Three different more specific containers that will define their own, more specialized, attributes. ? A toString method to make printing your objects more consistent across all your classes. Be sure to make use of method overriding in your subclasses. ? For the bonus, make sure that there is a recognizable additional specification created
Step by Step Solution
There are 3 Steps involved in it
Step: 1
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