Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Database 11g SQL

Authors: Jason Price

1st Edition

0071498508, 978-0071498500

More Books

Students also viewed these Databases questions

Question

In the two-factor research design, what is within-group variance?

Answered: 1 week ago

Question

=+ Who has this information?

Answered: 1 week ago

Question

1. Identify the sources for this conflict.

Answered: 1 week ago

Question

3. The group answers the questions.

Answered: 1 week ago