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...
By Anonymous on the 9th of Feb 2010 09:30:53 PM
Download |
Raw |
Embed |
Report
import java.lang.Math;
public class Sphere extends ThreeDimensionalShape {
public Sphere(int x, int y, double d1, double d2, double d3)
{
super(x, y, d1, d1, d3);
}
public void setRadius(double r)
{
setDimension1(r);
}
public double getRadius()
{
return getDimension1();
}
@Override
public double area()
{
return 4
*Math.
PI*Math.
pow(getDimension1
(), 2
);
}
@Override
public double Volume()
{
return (4
/3
)*Math.
PI*Math.
pow(getDimension1
(), 2
);
}
@Override
{
return "Sphere";
}
}
Submit a correction or amendment below.
[ previous version ] | [ difference ] | Make A New Post