An example that shows some of the key concept of inheritance in object-oriented programming, including:
- A lineage of classes,
A
,B
,C
. - visibility of inherited instance properties
- Overriding of inherited classes.
- A class
D
that shows composition rather than inheritance.