Chapter 28 Flashcards

1
Q

What is virtual function

A

A virtual function is a member function that you expect to be redefined in derived classes. When you refer to a derived class object using a pointer or a reference to the base class, you can call a virtual function for that object and execute the derived class’s version of the function.

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

What is static binding

A

Static binding means that target function for a call is selected at compile time

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

What is dynamic binding

A

Dynamic binding means that target function for a call is selected at run time.

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

What is limited polymorphism

A

When we have base class object/reference and it is pointing to derived class object/reference, so we can call derived class member functions through base class pointer/reference. It is called limited polymorphism.

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

Does C++ apply dynamic binding with virtual functions or we can say polymorphism uses virtual functions for dynamic binding

A

Yes

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