圆的面积

 1 class Demo111 {
 2       public static void main(String[] args) 
 3       {
 4           double b=getArea(2);
 5           System.out.println("圆的面积为:"+b);
 6 
 7           
 8       }
 9       //需求:写一个方法,计算圆的面积并返回
10       public static double getArea(int r){
11           double area=r*r*Math.PI;
12           return area;
13       }
14 }
原文地址:https://www.cnblogs.com/a709898670/p/9323096.html