public class Sphere {
  private double theRadius;
  public Sphere() {
    setRadius(1.0);
  } // end default constructor

  public Sphere(double initialRadius) {
    setRadius(initialRadius);
  } // end constructor

  public boolean equals(Object rhs) {
    return ((rhs instanceof Sphere) && (theRadius == ((Sphere)rhs).theRadius));
  } // end equals

  public void setRadius(double newRadius) {
    if (newRadius >= 0.0) {
      theRadius = newRadius;
    } // end if
  } // end setRadius

  public double radius() {
    return theRadius;
  } // end radius

  public double diameter() {
    return 2.0 * theRadius;
  } // end diameter

  public double circumference() {
    return Math.PI * diameter();
  } // end circumference

  public double area() {
    return 4.0 * Math.PI * theRadius * theRadius;
  } // end area

  public double volume() {
    return (4.0*Math.PI * Math.pow(theRadius, 3.0)) / 3.0;
  } // end volume

  public void displayStatistics() {
    System.out.println("\nRadius = " + radius() +
                       "\nDiameter = " + diameter() +
                       "\nCircumference = " + circumference() +
                       "\nArea = " + area() +
                       "\nVolume = " + volume());
  } // end displayStatistics
} // end Sphere
