Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Visual Basic Net Database Programming

Authors: Rod Stephens

1st Edition

0789726815, 978-0789726810

More Books

Students also viewed these Databases questions

Question

How was your life influenced by those events?

Answered: 1 week ago

Question

Which of these influenced your life most dramatically?

Answered: 1 week ago