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.


In the given example, what instrument's 'play' function message is expected when 'tune()' is called with a 'Brass' object?

  1. "Instrument::play"

  2. "Wind::play"

  3. "Brass::play"

  4. "None of the above"

The correct answer is: "Brass::play"

The 'play' function message that is expected when 'tune()' is called with a 'Brass' object should come from the specific 'Brass' class, not the more general 'Instrument' or 'Wind' class. Therefore, options A and B are incorrect. Option D is also incorrect because we are specifically asking for the 'play' function message from a 'Brass' object.