计算球体的体积。
// 来 自 时 代 J a v a - N o w J a v a . c o m import java.util.Scanner; public class Main { // obtain radius from user and display volume of sphere public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter radius of sphere: "); double radius = input.nextDouble(); System.out.printf("Volume is %f%n", sphereVolume(radius)); } // calculate and return sphere volume public static double sphereVolume(double radius) {