← All topics
Quiz: Inheritance and Virtual Functions: questions with answers
10 questions, each with the answer and a short explanation.
Take the timed quiz + get a certificate →- Q1. What makes a C++ class abstract?
- Q2. What does this print? (code)
- Q3. In what order do constructors run for a Derived object?
- Q4. Why should a polymorphic base class have a virtual destructor?
- Q5. What does the override keyword do?
- Q6. What does this print? (code)
- Q7. Can a derived class access the private members of its base class directly?
- Q8. In what order do destructors run when a Derived object is destroyed?
- Q9. Can you create an object of an abstract class?
- Q10. Which is runtime polymorphism in C++?