java編寫一個環形類?
public class Circle{
public static final double pie=3.14;
public static double area1(double r)
{
return pie*r*r;
}
public static double area2(double r)
{
return pie*r*r;
}
public static double circleArea()
{
return Circle.area1(圓1的半徑)-Circle.area2(圓2的半徑);
}
}
最后在主方法調用即可
下一篇購買macbook