class Circle{
double r;
Circle (){ circleNumber++;}
Circle (double r){
circleNumber++;
this.r=r;
}
double getArea(){
return Math.PI*r*r;
}
double getPerimeter(){
return 2*Math.PI*r;
}
}
public class TestCircle{
public static void main(String [] args)
{
public static int circleNumber=0;
Circle c1=new Circle(2.7);
Circle c2=new Circle(3.5);
System.out.println("已统计:"+circleNumber);
System.out.println("圆C1的面积是"+c1.getArea());
System.out.println("园C2的面积是"+c2.getArea());
System.out.println("园C1的周长是"+c1.getPerimeter());
System.out.println("园C2的周长是"+c2.getPerimeter());
}
}