// Inheritance Project // shapehierarchy Module // Source code file: Test1.java // Implements this inheritance hierarchy: // Rectangle --> Shape <-- Circle // Instance variables are set with the constructor. public class Test1 { public static void main(String[] args) { // Create and print red Shape object Shape s = new Shape(255, 0, 0); System.out.println(s.getColor( )); System.out.println(s); System.out.println( ); // Create and print green Rectangle object Rectangle r = new Rectangle(0, 255, 0, 2.5, 3.5); System.out.println(r.getColor( )); System.out.println(r.getArea( )); System.out.println(r); System.out.println( ); // Create and print green Circle object Circle c = new Circle(0, 0, 255, 3.0); System.out.println(c.getColor( )); System.out.printf("%.5f\n", c.getArea( )); System.out.println(c); } }