Java Programs

Please click on 1-2 Ads to keep this website's Study Material FREE and regularly Updated.

Program 2: Write a Java program to calculate the volume of the Sphere.

import java.util.Scanner;

public class Sphere
	public static void main(String[] args)
		//Declaring Variable		
		int radius;
		double Volume;
		double pie=3.14;

		Scanner s =new Scanner(;
		System.out.println("Enter the radius of Sphere");


		System.out.println("Volume: "+Volume);

If you have any suggestion or found any error in the above program, then do let us know at [email protected] or just comment below.