Answer:
See explaination
Step-by-step explanation:
//Cylinder.java
public class Cylinder extends Circle {
private double height;
public Cylinder(double h, double r) {
super(r);
setHeight(h);
}
public double getHeight() {
return height;
}
public void setHeight(double height) {
this.height = height;
}
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof Cylinder)) return false;
Cylinder cylinder = (Cylinder) o;
return Double.compare(cylinder.height, height) == 0 && Double.compare(cylinder.radius, radius) == 0;
}
}