Programming - C++ Language
You Are Here :: Home > C++ Language > constructor - General Questions
19. |
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
|
|
Answer: Option A
Explanation:
|
20. |
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.
|
|
Answer: Option D
Explanation:
|
21. |
Copy constructor must receive its arguments by __________ .
|
A. |
either pass-by-value or pass-by-reference |
B.
|
only pass-by-value |
C.
|
only pass-by-reference
|
D.
|
only pass by address
|
|
Answer: Option C
Explanation:
|
22. |
__________ 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
|
|
Answer: Option B
Explanation:
|
23. |
Constructors __________ to allow different approaches of object construction.
|
A. |
cannot overloaded |
B.
|
can be overloaded |
C.
|
can be called
|
D.
|
can be nested
|
|
Answer: Option B
Explanation:
|
24. |
Constructors __________ to allow different approaches of object construction.
|
A. |
cannot overloaded |
B.
|
can be overloaded |
C.
|
can be called
|
D.
|
can be nested
|
|
Answer: Option B
Explanation:
|
« prev
next »