Chapter 22 Flashcards
1
Q
What are 3 ways to inherit a class in C++
A
Public
Private
Protected
2
Q
What is Implicit Default constructor
A
Compiler generates implicit default constructor for any class in case we have not given any constructor for the class.
3
Q
What is Explicit Default constructor
A
If user has given constructor for any class without any arguments or with all arguments with default values then it is also default constructor according to definition but it is explicit (user defined) default constructor.
4
Q
How constructor called in inheritance
A
base class constructor called first and then drive class constructor
5
Q
How destructor called in inheritance
A
drive class destructor called first and then base class destructor. Reverse of constructor