public class Circle {
float radius;
public Circle(float cir_radius) {
radius=cir_radius;
}
public float getArea() {
return (float) (3.14*radius*radius);
}
public static void main(String[] args) {
// TODO Auto-generated method stub
Circle circle=new Circle(3);
System.out.println("半径为3的圆面积为:"+circle.getArea());
}
}