class Circle{
private double radius;
Circle(double r){
radius=r;
}
public void setRadius(double r){
radius=r;
}
public double getRadius(){
return radius;
}
public double getArea(){
return Math.PI*radius*radius;
}
}
class Cylinder{
private Circle bottom;
private double height;
Cylinder(Circle b,double h){
bottom=b;
height=h;
}
Cylinder(Cylinder cy){
bottom=cy.bottom;
height=cy.height;
}
public void setBottom(Circle b){
bottom=b;
}
public void setHeight(double h){
height=h;
}
public Circle getBottom(){
return bottom;
}
public double getHeight(){
return height;
}
public double getVolume(){
return height*bottom.getArea();
}
}
class Example01{
public static void main(String arg[]){
Circle c1=new Circle(5);
Cylinder cy=new Cylinder(c1,2);
System.out.println(cy.getVolume());
}
}
private double radius;
Circle(double r){
radius=r;
}
public void setRadius(double r){
radius=r;
}
public double getRadius(){
return radius;
}
public double getArea(){
return Math.PI*radius*radius;
}
}
class Cylinder{
private Circle bottom;
private double height;
Cylinder(Circle b,double h){
bottom=b;
height=h;
}
Cylinder(Cylinder cy){
bottom=cy.bottom;
height=cy.height;
}
public void setBottom(Circle b){
bottom=b;
}
public void setHeight(double h){
height=h;
}
public Circle getBottom(){
return bottom;
}
public double getHeight(){
return height;
}
public double getVolume(){
return height*bottom.getArea();
}
}
class Example01{
public static void main(String arg[]){
Circle c1=new Circle(5);
Cylinder cy=new Cylinder(c1,2);
System.out.println(cy.getVolume());
}
}