Programming - C++ Language
You Are Here :: Home > C++ Language > constructor - General Questions
25. |
It is a __________ error to pass arguments to a destructor.
|
A. |
logical |
B.
|
virtual |
C.
|
syntax
|
D.
|
linker
|
|
Answer: Option C
Explanation:
|
26. |
Which of the following statement is correct?
|
A. |
A destructor has the same name as the class in which it is present. |
B.
|
A destructor has a different name than the class in which it is present. |
C.
|
A destructor always returns an integer.
|
D.
|
A destructor can be overloade
|
|
Answer: Option A
Explanation:
|
27. |
A destructor takes __________ arguments.
|
A. |
one |
B.
|
two |
C.
|
three
|
D.
|
no
|
|
Answer: Option D
Explanation:
|
28. |
Which of the following cannot be declared as virtual?
|
A. |
Constructor |
B.
|
Destructor |
C.
|
Data Members
|
D.
|
Both A and C
|
|
Answer: Option D
Explanation:
|
29. |
How many constructors can a class have?
|
A. |
0 |
B.
|
1 |
C.
|
2
|
D.
|
any number
|
|
Answer: Option D
Explanation:
|
30. |
If the copy constructor receives its arguments by value, the copy constructor would
|
A. |
call one-argument constructor of the class |
B.
|
work without any problem |
C.
|
call itself recursively
|
D.
|
call zero-argument constructor
|
|
Answer: Option C
Explanation:
|
« prev
next »