Recent Posts
Ruby | 0 sec ago
PHP | 0 sec ago
None | 7 sec ago
None | 20 sec ago
None | 46 sec ago
None | 47 sec ago
None | 51 sec ago
None | 52 sec ago
None | 54 sec ago
JavaScript | 1 min ago
Sitereport
Find cool info about any domain on the internet?
visit sitereport
Free Subdomains
Want a pastebin.com sub-domain for your community?
learn more...
What is pastebin?
Pastebin is a website that hosts all your text & code on dedicated servers for easy sharing.
learn more...
Learn a little bit about the new Pastebin.com on our help page. hide message
By Anonymous on the 9th of Feb 2010 09:30:53 PM Download | Raw | Embed | Report
  1. import java.lang.Math;
  2.  
  3. public class Sphere extends ThreeDimensionalShape {
  4.  
  5.     public Sphere(int x, int y, double d1, double d2, double d3)
  6.     {
  7.         super(x, y, d1, d1, d3);
  8.     }
  9.  
  10.     public void setRadius(double r)
  11.     {
  12.         setDimension1(r);
  13.     }
  14.  
  15.     public double getRadius()
  16.     {
  17.         return getDimension1();
  18.     }
  19.  
  20.     @Override
  21.     public double area()
  22.     {
  23.         return 4*Math.PI*Math.pow(getDimension1(), 2);
  24.     }
  25.  
  26.     @Override
  27.     public double Volume()
  28.     {
  29.         return (4/3)*Math.PI*Math.pow(getDimension1(), 2);
  30.     }
  31.  
  32.     @Override
  33.     public String getName()
  34.     {
  35.        return "Sphere";
  36.     }
  37. }
Submit a correction or amendment below. [ previous version ] | [ difference ] | Make A New Post
To highlight particular lines, prefix each line with @h@
Syntax highlighting:
Post expiration:
Post exposure:
Name / Title:
Email: