Question OOP-CTOR-0021
EasyWhen is a constructor called?
- A.
Automatically, when an object is created
- B.
Only when the programmer calls it by name
- C.
Show answer and explanation
Answer: A
The constructor initialises the new object.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Constructors and Destructors question
When is a constructor called?
Automatically, when an object is created
Only when the programmer calls it by name
Answer: A
The constructor initialises the new object.
When an object is deleted
When the program ends