🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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 →
  1. Q1. What makes a C++ class abstract?
  2. Q2. What does this print? (code)
  3. Q3. In what order do constructors run for a Derived object?
  4. Q4. Why should a polymorphic base class have a virtual destructor?
  5. Q5. What does the override keyword do?
  6. Q6. What does this print? (code)
  7. Q7. Can a derived class access the private members of its base class directly?
  8. Q8. In what order do destructors run when a Derived object is destroyed?
  9. Q9. Can you create an object of an abstract class?
  10. Q10. Which is runtime polymorphism in C++?