Question: 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

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!