Programming - C++ Language
You Are Here :: Home > C++ Language > constructor - General Questions
1. |
If you design a class that needs special initialization tasks, you will want to design a(n) _____
|
A. |
housekeeping routine |
B.
|
initializer |
C.
|
constructor
|
D.
|
compiler
|
|
Answer: Option C
Explanation:
|
2. |
When you pass a variable _____, C++ passes only the contents of the variable to the receiving function
|
A. |
by reference |
B.
|
by value |
C.
|
globally
|
D.
|
locally
|
|
Answer: Option B
Explanation:
|
3. |
Sending a copy of data to a program module is called _______
|
A. |
passing a value |
B.
|
making a reference |
C.
|
recursion
|
D.
|
setting a condition
|
|
Answer: Option A
Explanation:
|
4. |
A __________ is a special method used to initialize the instance variable of a class.
|
A. |
Member function |
B.
|
Destructor |
C.
|
Constructor
|
D.
|
Structure
|
|
Answer: Option C
Explanation:
|
5. |
The constructor without parameter is called?
|
A. |
Method Constructor |
B.
|
Default Constructor |
C.
|
Operator Constructor
|
D.
|
Function Constructor
|
|
Answer: Option B
Explanation:
|
6. |
A Class can have how many destructor?
|
|
Answer: Option A
Explanation:
|
next »