FileDocCategorySizeDatePackage
Circle.javaAPI DocExample439Wed Apr 20 15:07:14 BST 2005None

Circle.java

public class Circle extends Shape {
  public static final double PI = 3.14159265358979323846;
  protected double r;                              // Instance data
  public Circle(double r) { this.r = r; }          // Constructor
  public double getRadius() { return r; }          // Accessor
  public double area() { return PI*r*r; }          // Implementations of
  public double circumference() { return 2*PI*r; } // abstract methods. 
}