Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The software I use is Eclipse, please show how to write it, thanks. Please write all things in one class. GeometricObject class public abstract class

The software I use is Eclipse, please show how to write it, thanks. Please write all things in one class.

image text in transcribed

GeometricObject class

public abstract class GeometricObject { private String color = "white"; private boolean filled; private java.util.Date dateCreated; protected GeometricObject() { dateCreated = new java.util.Date(); } protected GeometricObject(String color, boolean filled) { dateCreated = new java.util.Date(); this.color = color; this.filled = filled; } public String getColor() { return color; } public void setColor(String color) { this.color = color; } public boolean isFilled() { return filled; } public void setFilled(boolean filled) { this.filled = filled; } public java.util.Date getDateCreated() { return dateCreated; } public String toString() { return "created on " + dateCreated + " color: " + color + " and filled: " + filled; } public abstract double getArea(); public abstract double getPerimeter(); }
Modify the GeometricObject class to implement the Comparable interface and define a static max method in the GeometriObject class for finding the larger of two GeometricObject objects. Write a test program that uses the max method to find the larger of two circles, the larger of two rectangles

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

Practical Neo4j

Authors: Gregory Jordan

1st Edition

1484200225, 9781484200223

More Books

Students also viewed these Databases questions

Question

What role does the Five Forces Model play?

Answered: 1 week ago

Question

What is DDL?

Answered: 1 week ago