Chapter 22 Flashcards

1
Q

What are 3 ways to inherit a class in C++

A

Public
Private
Protected

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How constructor called in inheritance

A

base class constructor called first and then drive class constructor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How destructor called in inheritance

A

drive class destructor called first and then base class destructor. Reverse of constructor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly