All mock tests are FREE till 31 December — register to save your progress

Which of the following C++ statements correctly declares an abstract class?

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: A. class A { virtual void show() = 0; };

Explanation

A class is abstract if it has at least one pure virtual function, declared as virtual … = 0. '= 0' is only allowed on virtual functions.

More Programming Languages and Computer Graphics questions