--:--









Quiz for Constructors and destructors in inheritance

Course: C++ Language | Subject: Unit 6 | Topic: Inheritance



Logo

Q1: When is the base class constructor called in inheritance?

Logo

Q2: How many constructors are called when an object of derived class is created?

Logo

Q3: In what order are destructors called in inheritance?

Logo

Q4: Can a derived class constructor call a specific base class constructor?

Logo

Q5: What happens if base class constructor has parameters?

Logo

Q6: If base class has no default constructor, what must derived class do?

Logo

Q7: Are destructors inherited in C++?

Logo

Q8: What is the role of a virtual destructor in base class?

Logo

Q9: Can derived class constructor call multiple base class constructors in multiple inheritance?

Logo

Q10: What happens if derived class destructor is not virtual?

Logo

Q11: Can constructors be virtual in C++?

Logo

Q12: What is constructor chaining?

Logo

Q13: In inheritance, which constructor runs first?

Logo

Q14: If derived constructor does not initialize base class, which constructor is called?

Logo

Q15: Can a destructor be pure virtual?

Logo

Q16: Why must pure virtual destructors have a definition?

Logo

Q17: What is the order of constructor calls in multiple inheritance?

Logo

Q18: Is it possible to skip base class constructor call in derived class?

Logo

Q19: What happens if base class destructor is non-virtual and deleting derived object via base pointer?

Logo

Q20: How to explicitly call base class destructor?

Are you ready to start test? Set your time limit