# Unit 7 – Advanced Demo: Shape, Circle, Rectangle, Canvas

The basic demo showed that Circle and Rectangle are both shapes — each 
with its own formulas, but sharing the same idea of area and perimeter. 
This demo adds Canvas: a surface that holds any number of shapes at once 
and can work with them all together.

## Setting up

1. Compile `Shape`, `Circle`, `Rectangle`, and `Canvas`.
2. Try to create a `Shape` directly — BlueJ will not allow it.

## Experimenting

3. Create a `Canvas`.
4. Create a `Circle("red", 5.0)` and a `Rectangle("blue", 4.0, 6.0)`.
5. Call `add()` on the canvas with the circle, then again with the 
   rectangle.
6. Call `count()` — should return 2.
7. Call `totalArea()` — should return the sum of both shapes' areas.
8. Call `describeAll()` — should show a description of each shape.

## What to look at in the code

9. `Canvas` holds a `MutableList<Shape>` — it stores any subclass of 
   `Shape` because Circle and Rectangle are both Shapes.
10. `add()` takes a `Shape` parameter — you can pass a Circle or Rectangle 
    without Canvas needing to know which.
11. `totalArea()` iterates over the list and calls `area()` on each 
    shape — the correct formula runs automatically for each concrete type.
12. `describeAll()` does the same with `describe()` — the abstract class 
    acts as a common type for the whole collection.
