Which of the following statements related to C++ is FALSE?
2019
Which of the following statements related to C++ is FALSE?
- A.
Destructors have the same name as their class, preceded by a tilde (~) character.
- B.
Destructors can be virtual, but constructors cannot.
- C.
Constructors have neither “return” value nor “void”.
- D.
Constructors can be virtual, but destructors cannot.
Attempted by 181 students.
Show answer & explanation
Correct answer: D
Answer: The statement "Constructors can be virtual, but destructors cannot" is false. Explanation: Constructors cannot be virtual. Virtual dispatch relies on the object's virtual table, which is not fully established during construction, and the language disallows declaring constructors as virtual.