Exercise 11.1: (The Triangle class)
Design a class named Triangle that extendsGeometricObject.java
. The class contains:
? Three double data fields named side1, side2, and side3 withdefault values 1.0 to denote three sides of the triangle.
? A no-arg constructor that creates a default triangle.
? A constructor that creates a triangle with the specified side1,side2, and side3.
? The accessor methods for all three data fields.
? A method named getArea() that returns the area of thistriangle.
? A method named getPerimeter() that returns the perimeter of thistriangle.
? A method named toString() that returns a string description forthe triangle.
For the formula to
PayPal Gateway not configured
PayPal Gateway not configured