/**
 * @author Kevin YAng
 * @version Lab Quiz 1
*/

public class Sphere{
   private double radius;
   public Sphere(){
      radius = 1.0;
   }
   
   public Sphere(double radius){
      if(radius <= 0){
         throw new IllegalArgumentException();
      }
      else{
         this.radius = radius;
      }
   }

   public double getRadius(){
      return this.radius;
   }

   public void setRadius(double setr){
      this.radius = setr;
   }

   public double getSurfaceArea(){
      double SA = 4.0 * Math.PI * (this.radius * this.radius);
      return SA;
   }

   public double getVolume(){
      double Vol = (4.0/3) * Math.PI * (this.radius*this.radius*this.radius);
      return Vol;
   }

   public boolean equals(Sphere sphere){
      boolean tf = false;
      if(this.radius == sphere.radius){
         return true;
      }
      return tf;
   }

   public String toString(){
      String thisSph = this.getClass().getName();
      String testSph =  getClass().getName();
      String msg;
      if(thisSph.equals(testSph)){
         msg = "The Sphere class is mutable";
      }
      else{
         msg = "The Sphere class is immutable!";
      }
      return msg;
   }
}
