Mastering C++: A Comprehensive Quiz Based on 'Thinking in C++

Image Description

Question: 1 / 565

Which function does NOT need to have the 'virtual' keyword in order for polymorphism to be applied in derived classes?

Base class function

First derived class function

Second derived class function

In order to apply polymorphism, the virtual keyword is only necessary for the base class function and the first derived class function. If the virtual keyword is added to any function in a derived class beyond the first one, it will have no effect on the function. Therefore, the second derived class function does NOT need to have the 'virtual' keyword in order for polymorphism to be applied, making it the correct answer out of the four options.

Get further explanation with Examzify DeepDiveBeta

All of the above

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy