Use a breakpoint to observe when constructor parameters become stored Player state. The highlighted line is normally the next statement to execute, not evidence that it has already run.
Use the complete Player definition from the parameterized-constructor lesson.
Player jordan = new Player("Jordan", 7);this.name = name; in the Player constructor.name, jerseyNumber, and the fields under this in Locals.Step Over to execute the name assignment, then the jersey assignment.| Paused moment | Parameter name | Stored name | Stored jerseyNumber |
|---|---|---|---|
| Before first assignment | Jordan | null | 0 |
| After name assignment | Jordan | Jordan | 0 |
| After jersey assignment | Jordan | Jordan | 7 |
These are expected observations for the linked class, whose fields have no initializers. Locals formatting can differ by IDE version. Expand this to distinguish the object fields from same-named parameters.
Create Casey next with jersey 12. The constructor runs again with different parameters and a different this reference. Jordan retains its own state.