//接口 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);
}

}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-22
  • 2022-12-23
  • 2021-11-27
  • 2021-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-09
  • 2021-05-26
  • 2021-12-06
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案