Answered step by step
Verified Expert Solution
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.
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started