

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 4
click for more info
Not enough gems
Cost: 6 gems
1: Inheritance
incomplete
2: When to Inherit
incomplete
3: Inheritance Hierarchy
incomplete
4: Inheritance Quiz
incomplete
5: Multiple Children
incomplete
6: Adding a Wizard
incomplete
7: Wide Not Deep
incomplete
8: Dragons
incomplete
9: Dragons Fight
incomplete
10: Inheritance Practice
incomplete
11: Inheritance Practice
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
It's more common for an inheritance tree to be wide than deep.
In your application code, you likely won't see a Camera class inherit from a chain of 13 classes up to Equipment. If you do: run. There are better organizations to work for, I swear.
A child class must fit every parent class "type" above it. That just doesn't happen very often in a deep tree. It's more likely that you'll have a base class with many child classes that are slightly different variations of the base. They're all "siblings" of each other.