# Java Program to Calculate Area and Circumference of Circle

Hello guys, in today’s post we will learn to write Java program to calculate area and circumference of circle. Writing Java program for calculating area and circumference of circle is very easy. So let’s start and see how to do it in Java.

To find area and circumference of circle first we need to know the formula. Here is the formula –

Area of circle = πrsquare units

Circumference of circle = 2πr

Where,

• r is the radius of the circle.
• π is a constant whose value is 3.1415 or 22/7.

Now let’s learn how to calculate them in Java.

## Java Program to Calculate Area and Circumference of Circle

### What we did ?

We have written Java program to calculate area and circumference of circle successfully. Now we will explain what we did to find area and circumference of a circle in Java.

• First of all we imported util package.
• Then we have created a public class named as Circle.
• Inside Circle class we created main() method.
• Then we have declared variables which are used in this program.
• Now we created object of the Scanner class.