Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java For this Lab, you will create 3 classes: CounterTop , Laminate , Granite . The CounterTop will be the super class to the other

Java

For this Lab, you will create 3 classes: CounterTop, Laminate, Granite. The CounterTop will be the super class to the other 2 classes.

The shared field variables will be the length, width and depth. The Laminate will have field variables for pattern. The Granite class will have a field variable for name and origin (country it came from). Use appropriate names and datatypes for all field variables.

Create appropriate constructors for each class (a default and one that passes in the data).

Create the appropriate get and set methods. All classes should have a toString method. The subclasses should utilize the super class's toString method.

Inside the CounterTop class, create a main method. Inside the main method, make an ArrayList that stores CounterTop objects. Create at least one of each class and add it to the ArrayList. Then loop through the ArrayList and output the details for each object.

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_2

Step: 3

blur-text-image_3

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

Microsoft Visual Basic 2017 For Windows Web And Database Applications

Authors: Corinne Hoisington

1st Edition

1337102113, 978-1337102117

More Books

Students also viewed these Databases questions