计算半径为10的圆的面积
代码
public class ComputeArea
{
public static void main(String args[])
{
final double PI=3.14159;
double area;
area=PI*10*10;
System.out.println("The area for the circle of 10 is "+area);
}
}
运行结果
The area for the circle of 10 is 314.159