Question OOP-CTOR-0073
HardIn Java, what runs first when a subclass object is created?
- A.
The main method
- B.
The finalize() method
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Constructors and Destructors question
In Java, what runs first when a subclass object is created?
The main method
The finalize() method
Sign up free to see the answer and a step-by-step explanation.
The child's constructor body
Static initialisers (once per class), then instance initialisation of the parent, then the child