Question OOP-ABS-0006
EasyHow is an abstract class created in C++?
- A.
By making all members static
- B.
By declaring at least one pure virtual function (= 0)
- C.
Show answer and explanation
Answer: B
virtual void area() = 0; makes the class abstract.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Abstraction and Interfaces question
How is an abstract class created in C++?
By making all members static
By declaring at least one pure virtual function (= 0)
Answer: B
virtual void area() = 0; makes the class abstract.
By making the constructor private
With the abstract keyword