by Dinesh Thakur Category: Data Type

In Volume of a Sphere in Java Example , Math.PI is used because it denotes the value of pi i.e. 3.1414. Math.pow(r,3.0) is used for computing y3

Here is the Java Example for Volume of a Sphere

class  VolumeSphere

             public  static  void  main  (String  args [ ] )           
               int    r;                       
              double  m,v;                      
              v= (double)4/3*Math.PI*m;                       
             System.out.println("Volume  of  a  Sphere  is  "+v);          

Volume of a Sphere in Java

About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.

Search Content