Question: In Java. Create an abstract class Shape with the following specifications:an abstract method area ( ) of return type doublean abstract method perimeter (

In Java. Create an abstract class "Shape" with the following specifications:an abstract method "area()" of return type doublean abstract method "perimeter()" of return type double.Put your code in a Java source file named "Shape.java."I.Create a class "Rectangle" that extends the Shape class with the following specifications:Attributes:width, lengthConstructor:Implement a parameterized constructor needed initialize the data.toString:Implement a "toString" method that prints out the area and perimeter.Implement methods to compute the area and perimeter.II.Create a class "Circle" that extends the Shape class with the following specifications:Attributes:radiusConstructor:Implement a parameterized constructor to initialize the data.toString:Implement a "toString" method that prints out the area and perimeter.Implement methods to compute the area and perimeter.III.Create a class "Triangle" that extends the Shape class with the following specifications:Attributes:length of side1, length of side2, length of side3, each is a doubleConstructor:Implement a parameterized constructor to initialize the data.toString:Implement a "toString" method that prints out the area and perimeter.Implement methods to compute the area and perimeter.IV.Create a driver class named "ShapeArray" with the following specifications:Instantiate one triangle.Instantiate one circle.Instantiate one square.Store the class instances into an array named "shapeArray."Loop through the array and print out the instance data of each objectusing the object instance's "toString" method.Show a UML diagram of your project.

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 Accounting Questions!