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

Write a class named Hexagon that extends GeometricObject 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 GeometricObject implements Cloneable, Comparable { private double side; /** Construct a Hexagon with the specified side */ public Hexagon(double side) { // Implement it }

@Override public double getArea() { // Implement it () }

@Override public double getPerimeter() { // Implement it }

@Override public int compareTo(Hexagon obj) { // Implement it (compare two Hexagons based on their sides) }

@Override public Object clone() { // Implement it } }

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!