Build a class out of parts it holds instead of a parent it copies, and swap the parts when needs change.
You finished "Reading and drawing class diagrams": you can read a class box, the hollow triangle of "is a" and the diamonds of "has a".
You finished the Programming fundamentals path: you can write a class with a constructor and methods, build a child class on a parent, and call a method through an interface or on any object that has it.
Lesson 1 · Is a, or has a?
Next: 4 · Interfaces and polymorphism in design · 5 lessons · 1 h
Try the same model with your own values. No checks, nothing recorded.
Open the playground