Card 09/ 09
All 9 cards
RecapDifficulty: Intermediate1 min
What an Object Has That a Class Does Not
Five things this topic established, and where each one was.
| The thing | Where |
|---|---|
A class describes; new creates; a reference points | A Class Is a Description |
A constructor is named for the class, declares no return type, and runs inside new | The Method That Runs Before the Object Exists |
Constructors are chosen by argument list, and this(...) chains them | Two Constructors for One Order |
| Writing any constructor removes the free no-argument one | Why Adding a Constructor Broke Every new Order() |
static belongs to the class; instance members belong to one object | static Belongs to the Class |
An object has its own copy of every instance field, and that is the only thing it has that the class does not. Everything else in this topic follows from asking which of the two something belongs to.