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

Disable ads (and more) with a membership for a one time $2.99 payment

Test your C++ skills with our quiz based on Bruce Eckel's 'Thinking in C++'. Dive into object-oriented programming, advanced topics, and fundamentals. Perfect for learners and experts alike. Assess your knowledge and become a C++ master!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


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

  1. Base class function

  2. First derived class function

  3. Second derived class function

  4. All of the above

The correct answer is: 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.