Card 10/ 10
All 10 cards
RecapDifficulty: Advanced1 min
What extends Gives, and in What Order
Five things this topic established, and where each one was.
| The thing | Where |
|---|---|
| A subclass gets the parent's members but not its constructors | What a Subclass Gets Without Asking |
| Constructors are entered downwards and complete upwards, most general first | The Constructor Chain Runs Upwards |
| Same name and same parameter list is overriding; a different list is overloading | Overriding Replaces a Body |
super(...) is inserted for you, and super.method() reaches one level up | What super Reaches |
A private parent field exists in the object and cannot be named by the subclass | Why Your Subclass Cannot See a private Field |
The one worth carrying: extends decides what an object contains, and access modifiers decide what your source may name. Those are two different questions, and almost every confusing inheritance error is one of them being mistaken for the other.