package top.qaqaq.java.P284;
public class Circle {
private double radius;
public Circle() {
super();
radius = 1;
}
public double getRadius() {
return radius;
}
public void setRadius(double radius) {
this.radius = radius;
}
public double findArea() {
return Math.PI * radius * radius;
}
}
package top.qaqaq.java.P284;
public class Cylinder extends Circle {
private double length;
public Cylinder() {
super();
length = 1;
}
public double getLength() {
return length;
}
public void setLength(double length) {
this.length = length;
}
public double findVolume() {
return super.findArea() * length;
}
public double findArea() {
return 2 * Math.PI * getRadius() * getRadius() + 2 * Math.PI * getRadius() * length;
}
}