Question: Simple Container Classes Requirements: ? A general Container class that your other classes will inherit from. ? Three different more specific containers that will define

Simple Container Classes

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.

? Make sure that there is a recognizable additional specification created.

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).

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. Additionally, define a subclass of one of your subclasses to be an even more specialized version of it.

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!