Question: java Coding please for solution ThreeDShape is an abstract class that models a 3D shape with the following methods: int volume(): measures the volume of
java Coding please for solution
ThreeDShape is an abstract class that models a 3D shape with the following methods: int volume(): measures the volume of the 3D Shape int perimeter(): measures the perimeter of the 3D Shape A Cube is class that extends ThreeDShape and it has a side of type int. The constructor of Cube takes a variable to initialize the side. The volume of a cube is equal to side3 and the perimeter is equal to 12*side. Cube class also overrides toString() to display a message showing the permiter and volume of the cube. Write the code for the ThreeDShape class and for the Cube Class (there is no need for the main method).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
