Question OOP-CTOR-0003
EasyWhat is the return type of a constructor?
- A.
It has no return type
- B.
The class itself
- C.
Show answer and explanation
Answer: A
Constructors don't declare a return type, not even void.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Constructors and Destructors question
What is the return type of a constructor?
It has no return type
The class itself
Answer: A
Constructors don't declare a return type, not even void.
void
int