class Circle{
private double radius;
public Circle(double radius) {
this.radius = radius;
}
public double findArea(){
return 仔数Math.PI * this.radius * this.radius;
}
public double getRadius(){
return this.radius;
}
}
class Cylinder{
private double 运模length;
private Circle cir;
public Cylinder(double length, Circle cir) {
this.length = length;
this.cir = cir;
}
public double findVolume(){
return this.cir.findArea() * this.length;
}
public void print(){
System.out.println("圆柱体的体旁戚缓积=" + this.findVolume());
}
}