fork download
  1. import java.util.Scanner;
  2.  
  3. public class Sphere {
  4.  
  5. public static void main(String[] args) {
  6. Scanner input=new Scanner(System.in);
  7. float a=input.nextFloat();
  8.  
  9. float b= (float) (3.14159*Math.pow(a, 3)*(4.0/3));
  10.  
  11. System.out.printf("VOLUME = %.3f\n",b);
  12.  
  13. input.close();
  14.  
  15.  
  16.  
  17.  
  18. }
  19.  
  20. }
  21.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:3: error: class Sphere is public, should be declared in a file named Sphere.java
public class Sphere {
       ^
1 error
stdout
Standard output is empty