Java Learner logo

Module 7: Advanced Object-Oriented Concepts

Lesson focus

Mini-Project: Shape Hierarchy

Build an extensible shape system that calculates area/perimeter and renders SVG output.

Define an abstract Shape with abstract area() and perimeter() plus a render() default method.

Implement concrete shapes (Circle, Rectangle, Triangle) and experiment with sealed interfaces to constrain valid shapes.

Add a ShapeRenderer strategy (SVG, ASCII) to demonstrate polymorphism and composition working together.

Lesson quiz

What design goal should the shape mini-project emphasize?

Next lesson →