//接口 ShapePara
package d922B;
public interface ShapePara {
int getArea();
int getCircumference();
}
//圆类
package d922B;
public class Circle implements ShapePara {
public double radius;
private double x;
protected double y;
Circle(double r)
{
radius=r;
x=0;
y=0;
}
double getRadius()
{
return radius;
}
void setCenter(double a, double b)
{
x=a;
y=b;
}
void setRadius(double r)
{
radius=r;
}
public int getArea() {
return(int) (Math.PI*radius*radius);
}
public int getCircumference() {
return (int) (2*Math.PI*radius);
}
}