Curioustab
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Constructors and Destructors Questions
__________ used to make a copy of one class object from another class object of the same class type.
A __________ is a constructor that either has no parameters, or if it has parameters, all the parameters have default values.
Which of the following statement is correct about constructors?
Constructors __________ to allow different approaches of object construction.
How many default constructors per class are possible?
To ensure that every object in the array receives a destructor call, always delete memory allocated as an array with operator __________ .
Which of the following gets called when an object goes out of scope?
Which of the following cannot be declared as virtual?
Which of the following are NOT provided by the compiler by default?
Destructor has the same name as the constructor and it is preceded by ______ .
If the programmer does not explicitly provide a destructor, then which of the following creates an empty destructor?
When are the Global objects destroyed?
Which of the following statement is correct?
Which of the following implicitly creates a default constructor when the programmer does not explicitly define at least one constructor for a class?
Which of the following never requires any arguments?
How many times a constructor is called in the life-time of an object?
Which of the following statement is correct whenever an object goes out of scope?
Which of the following gets called when an object is being created?
Which constructor function is designed to copy objects of the same class type?
What will be the out of the following program? #include<iostream.h> class CuriousTabBase { public: int x, y; public: CuriousTabBase(int xx = 0, int yy = 0) { x = xx; y = yy; } }; class CuriousTabDerived : public CuriousTabBase { private: CuriousTabBase objBase; public: CuriousTabDerived(int xx, int yy) : CuriousTabBase(xx), objBase(yy) { cout << this->x << " " << this->y << " " << objBase.x << " " << objBase.y << " "; } ~CuriousTabDerived() { } }; int main() { CuriousTabDerived objDev(11, 22); return 0; }
1
2
3