Ace Your C++ Skills 2025 – Rock the ‘Thinking in C++’ Challenge!

Question: 1 / 565

What is the result of calling 'play()' on a 'Brass' object when 'play()' is made virtual?

It calls the most closely matched overridden function in the hierarchy

When a virtual function is called from a derived class object, it will call the most closely matched overridden function in the hierarchy. This means that if a 'Brass' object has a 'play()' function defined, it will call that function instead of the 'play()' function from the base class. Option B is incorrect because virtual functions do not default to the base class implementation. Option C is incorrect because virtual functions do not generate runtime errors. Option D is also incorrect because the correct answer is A.

Get further explanation with Examzify DeepDiveBeta

It defaults to the base class implementation

It generates a runtime error

None of the above

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy