public abstract class Shape { public abstract double area(); public abstract double circumference(); } class Circle extends Shape { protected double r; protected static final double PI = 3.14159265358979323846; public Circle() { r = 1.0; } public Circle(double r) { this.r = r; } public double area() { return PI * r * r; } public double circumference() { return 2 * PI * r; } public double getRadius() { return r; } } class Rectangle extends Shape { protected double w, h; public Rectangle() { w = 0.0; h = 0.0; } public Rectangle(double w, double h) { this.w = w; this.h = h; } public double area() { return w * h; } public double circumference() { return 2 * (w + h); } public double getWidth() { return w; } public double getHeight() { return h; } }