# Java Program to Calculate Volume of Sphere

• Java Program to find the volume of sphere.
• Java Program to find the total surface area of sphere.

To find the volume and surface area of a sphere, we want the length of it's radius. Before jumping into the java program, here is the brief summary of spheres.

A sphere is a three dimensional object such that all points on sphere are located at a distance R (radius of sphere) from a given point (center of sphere). A sphere is perfectly symmetrical and has no edges or vertices. Finding volume and surface area of a sphere help us to solve many real life problems like, how much water can be filled in a hollow spherical can.

How to Calculate the Volume of Sphere ? The volume of sphere is defined as the amount of three dimensional space occupied by the sphere. To calculate the volume of a sphere, we need radius of sphere. Volume of sphere is measured in cubic units.
Volume of Sphere = 4/3 x PI x R3
Where, R is the radius of sphere.
How to Find the Total Surface Area of Sphere ?
Surface area of sphere is the number of square units that will exactly cover the outer surface of sphere. There is only one curved surface in sphere, no edges and corners. Total surface area of a sphere is measured in square units like cm2, m2 etc.
Total Surface Area of Sphere = 4ΠR2
Where, R is the radius of sphere.
The total surface area of sphere is four times the area of a circle of same radius.

## Java program to find surface area and volume of sphere

In this java program, we first take the radius of sphere as input from user and then calculate the volume and surface of spheres using the formulae mentioned above.

```package com.tcc.java.programs;

import java.util.Scanner;

/**
* Java Program to find volume and surface area of sphere
*/
public class VolumeOfSphere {

public static void main(String[] args) {
Scanner scanner;
scanner = new Scanner(System.in);
// Take input from user

/*
* Surface area of Sphere = 4 X PI X Radius X Radius
*/
/*
*/
```Enter Radius of Sphere