Question OOP-CTOR-0004
EasyWhat is a default constructor?
- A.
A constructor that is private
- B.
The first constructor in a class
- C.
Show answer and explanation
Answer: C
If you write no constructor, the compiler supplies a default one.
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 a default constructor?
A constructor that is private
The first constructor in a class
Answer: C
If you write no constructor, the compiler supplies a default one.
A constructor that takes no arguments
A constructor with default return type