Java Program to Find Area of a Circle

The formula for finding area of a circle is,

area = PI * radius * radius

Where PI is a constant (approximately 3.1416) and radius is the radius of the circle.

Calculate Area of a Circle in Java

The following Java program calculates the area of a circle given the radius of the circle. This program demonstrates a number of key concepts in Java programming,

  • How to obtain user input from console
  • How to write output to console
  • How to use IO classes and decorator pattern
  • Using library classes such as Math, BufferedReader, Double etc.
  • Performing mathematical calculations
// Java program to calculate area of a circle

public class CircleArea {
     public static void main(String[] args) throws IOException{
        BufferedReader reader = new BufferedReader(new InputStreamReader(;
        System.out.print("Please enter the radius of the circle : ");
        double radius = Double.parseDouble(reader.readLine());
        double area = Math.PI * radius * radius;
        System.out.println("Area of the circle with radius "+radius+" is : "+area);

Do you have a programming problem that you are unable to solve? Please send us your problem and we will publish the solution on this site within 48 hours! Please email us.

One Response to “Java Program to Find Area of a Circle”

  1. import java.util.Scanner;
    class Circle
    public static void main(String[] args)
    Scanner sc=new Scanner(;
    System.out.println(“plz enter a radius”);
    int i=sc.nextInt();
    System.out.println(“area of Circle=”+3.14*i*i);

Leave a Reply