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 C++ feature allows a derived class member function to have the same name but act differently from a base class function?

  1. Overloading

  2. Overriding

  3. Inheriting

  4. Handing

The correct answer is: Overriding

Overriding is the correct term for a derived class member function to have the same name and parameters as a base class function but behave differently. This is a key feature of object-oriented programming as it allows for polymorphism, where the same name can be used to execute different behaviors. Option A, overloading, refers to having multiple functions or operators with the same name but different parameters. Option C, inheriting, is related to the overall concept of derived and base classes, but does not specifically address the behavior of a specific member function. Option D, handing, is not a recognized term in C++ and does not address the question.