📜  用于查找圆面积的Java程序

📅  最后修改于: 2022-05-13 01:58:09.502000             🧑  作者: Mango

用于查找圆面积的Java程序

可以使用以下公式简单地评估圆的面积。

Area = pi * r2
where r is radius of circle 
Java
// Java program to find area
// of circle
      
class Test
{
    static final double PI = Math.PI;
           
    static double findArea(int r)
    {
       return PI * Math.pow(r, 2);
    }
           
    // Driver method
    public static void main(String[] args) 
    {
        System.out.println("Area is " +  findArea(5));
    }
}
Please refer complete article on Program to find area of a circle for more details!