728by90ad
Constructors and Destructors Questions And Answers.
Exercise ::
Constructors and Destructors
1. A constructor that accepts parameters is called the default constructor?
A. one B. two C. three D. four
View Answer
Discuss forum
Workplace
Report
Published by:Michael Daani
2. What happens when a class with parameterized constructors and having no default constructor is used in a program and we create an object that needs a zero-argument constructor?
A. Compile-time error. B. Preprocessing error. C. Runtime error. D. Runtime exception.
View Answer
Discuss forum
Workplace
Report
Published by:Michael Daani
Published by:Michael Daani
4. Destructor has the same name as the constructor and it is preceded by?
A. ! B. ? C. ~ D. $
View Answer
Discuss forum
Workplace
Report
Published by:Michael Daani
5. For automatic objects, constructors and destructors are called each time the objects?
A. enter and leave scope B. inherit parent class C. are constructed D. are destroyed
View Answer
Discuss forum
Workplace
Report
Published by:Michael Daani