/** * SphereUtil * * This class caluclates a sphere's volume and surface area. * Since I don't specify "public class" the class is considered to have * package access. Package access means that only other classes in the * same package as this class can use this class. * Public access means that anyone can access the class. * Other access modifiers are: protected, and private. * * @author Brad Rippe */ class SphereUtil { /** * This method calucates the volume of sphere * the modifier "static" states that this method belongs to all instances of the * class, not just on instance. */ public static double volume (double r) { return 4.0/3 * Math.PI * Math.pow(r, 3); } public double surArea (double r) { return 4 * Math.PI * Math.pow(r, 2); } } // finish class SphereUtil