Worked example
Shape[] shapes = { new Circle(1), new Rect(2, 3) };
for (int i = 0; i < shapes.length; i++) {
System.out.println(shapes[i].name() + ": " + shapes[i].area());
}
// Circle: 3.14
// Rect: 6.0
One loop, one contract, two very different area formulas.