📜  如何在java代码示例中创建一个圆圈

📅  最后修改于: 2022-03-11 14:52:24.291000             🧑  作者: Mango

代码示例1
import java.util.Scanner;
public class AreaOfCircle {
   public static void main(String args[]){
      int radius;
      double area;
      Scanner sc = new Scanner(System.in);
      System.out.println("Enter the radius of the circle ::");
      radius = sc.nextInt();
      area = (radius*radius)*Math.PI;
      System.out.println("Area of the circle is ::"+area);
   }
}