The Triangleclass
Design a class named Triangle that extendsGeometricObject. The class contains:
1 Three double data fields namedside1, side2, andside3 with default values 1.0 todenote three sides of a triangle.
2 A no-arg constructor that creates a default triangle.
3 A constructor that creates a triangle with the specifiedside1, side2, andside3.
4 The accessor methods for all three data fields.
5 A method named getArea() that returns thearea of this triangle.
6 A method named getPerimeter() that returnsthe perimeter of this triangle.
7 A method named toString() that returns astring description for the triangle. (Overriding method)
The formula to compute the area of a triangle:
sides a,b and c
s=a+b+c2 Area=s(s-a)(s-b)(s-c)
The
OR
OR