C++ Constructors Question:

Can a class have virtual destructor?

A. Yes
B. No

Answer:

Option A
Yes

Read All 51 C++ Constructors Questions
Previous QuestionNext Question
What happens when a class with parameterized constructors and having no default constructor is used in a program and we create an object that needs a zero-argument constructor?

A. Compile-time error.
B. Preprocessing error.
C. Runtime error.
D. Runtime exception.
Destructor has the same name as the constructor and it is preceded by ______ .

A. !
B. ?
C. ~
D. $