# Java program to find circumference of a circle

Let’s learn java program to find circumference of a circle.

## Java program to find circumference of a circle

To calculate circumference of circle in java, first we have to get radius of circle from user using nextInt() method of Scanner class.

This user entered number is stored in integer variable “radius”. Then find circumference of a circle using below formula. To find circumference of a circle formula is,

circumference = 2πr

Circumference of circle is twice the product of radius and value of PI. This product is stored in double variable “circumference”.

Lastly circumference is printed on console. Here’s the java program to calculate circumference of circle.

```import java.util.Scanner;
public class CircumferenceOfCircleJava
{
public static void main(String[] args)
{
double circumference;
Scanner sc = new Scanner(System.in);
circumference = Math.PI * 2 * radius;
System.out.println("Circumference of circle : " + circumference);
sc.close();
}
}

```

Output: