Question: Write a class named Hexagon that extends Geometric Object and implements the Comparable interface. Assume all six sides of the hexagon are of equal size.

 Write a class named Hexagon that extends Geometric Object and implements

Write a class named Hexagon that extends Geometric Object and implements the Comparable interface. Assume all six sides of the hexagon are of equal size. The Hexagon class is defined as follows: public class Hexagon extends Geometric Object implements Comparable {private double side;/** Construct a Hexagon with the specified side */public Hexagon(double side) {//Implement it}/** Implement the abstract method getArea in GeometricObject */public double getArea() {//Implement it (area = 3 * Squareroot 3 * side * side)}/** Implement the abstract method getPerimeter in GeometricObject */public double getPerimeter() {//implement it}/** implement the compareTo method in the Comparable interface to */public int compareTo (object obj) {//Implement it (compare two Hexagons based on their areas)

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