QuizNot attempted
Class fields and inheritance
1–4 to choose, Enter to submit
Show answer & explanation
Correct answer:
- Right after super() returns, before the rest of the subclass constructor
- In a derived class, fields are defined on
thisright aftersuper()returns, before the rest of the subclass constructor body runs. - Not before the parent constructor:
thisdoesn't exist until the parent creates it, which is why a parent calling an overridden method sees the fields asundefined. - Not lazily: fields are eager per instance.
- Not after the whole constructor: code after
super()can already read them.