Write a Concrete Subclass of an Abstract Solid
mediumQuestion 548Solid is an abstract class that stores a name and leaves volume() and surfaceArea() abstract. Write the concrete class Cuboid (a box) that extends it.
Requirements:
1. Three private double fields: width, depth and height.
2. A public constructor Cuboid(double width, double depth, double height) that calls the Solid constructor with the name Cuboid and stores the three values.
3. volume() returns width * depth * height.
4. surfaceArea() returns twice the sum of the three different faces: width * depth, width * height and depth * height.
5. Leave describe() alone. It is inherited from Solid and calls both of your methods.
Do not change the Solid class.
Do NOT write a main method.
Expected output
Cuboid 24.0 52.0 Cuboid: volume 24.0, surface 52.0
= newline. The output ends with a newline, so print one after the last line.
Your output
Run your code to see the output here...