// Inheritance Project // shapehierarchy Module // Source code file: Circle.java // Implements this inheritance hierarchy: // Rectangle --> Shape <-- Circle // Instance variables are set with the constructor. public class Circle extends Shape { // Instance variable private double radius; // Constructor public Circle(int r, int g, int b, double rad) { super(r, g, b); radius = rad; } // For a circle, area = PI * r ^ 2 public double getArea( ) { return Math.PI * Math.pow(radius, 2.0); } @Override public String toString( ) { return String.format("Circle -- Color %s Radius: %.4f", getColor( ), radius); } }