Monday, September 29, 2014

Constructors and Destructors - C++

1. 
A function with the same name as the class, but preceded with a tilde character (~) is called __________ of that class.
A.constructorB.destructor
C.functionD.object
2. 
A union that has no constructor can be initialized with another union of __________ type.
A.differentB.same
C.virtualD.class
3. 
Which of the following gets called when an object goes out of scope?
A.constructor
B.destructor
C.main
D.virtual function
4. 
Which of the following statement is correct?
A.Destructor destroys only integer data members of the object.
B.Destructor destroys only float data members of the object.
C.Destructor destroys only pointer data members of the object.
D.Destructor destroys the complete object.
5. 
__________ used to make a copy of one class object from another class object of the same class type.
A.constructor
B.copy constructor
C.destructor
D.default constructor

No comments: